You're talking yourself in the right direction... (that is: the words you're saying should be giving you a hint as to what you need to do!)
you have a text string: "18/12/2013" Excel does see this as a "date", it sees it as 10 characters. you cannot "add" a number to text. It's like adding "three" + 7. older programming languages would LET you do that, and give the result as "three7" The fact is, the Programmers of Microsoft recognize that true "DATES" can be displayed an thousands of different ways. So they decided to "standardize" on the basic date VALUE, and simply display this single value in very flexible ways. to Excel, a DATE is the number of days since 1/1/1900. So today, 21-Feb-2013 is 41326 if you want to add 7 to today's date, you simply use: 41326+7 you get 41333, then DISPLAY it in any format you like. If you display it in dd/mm/yyyy format, it LOOKS like 02/28/2013 So... back to your question... you SAID: I am already try this =A1+7. this is not working. because date format is dd/mm/yyyy well... that's not precisely true... the STRING format looks like dd/mm/yyyy what YOU need to do is tell EXCEL that this STRING is a date your WINDOWS operating system has settings for date format. different regions (worldwide) show dates differently. In the USA, a date of 18-Feb-2013 is represented as 20/18/2013 while in many places, the date would be 18/02/2013 IF your windows system says that the default date format is 02/18/2013, and a cell has a value of 18/02/2013, Excel will not recognize it as a date, and simply leave the contents as "General" or "Text". oddly enough, if the date were 10-Feb-2013 and entered as 10/02/2013 and if WINDOWS expects mm/dd/yyyy even though YOU entered what you thought as dd/mm/yyyy, Excel would store it as October 2, 2013. So.. the dates need to be entered in the format your WINDOWS system (not excel) expects. try this: enter feb 5 into a cell. change the format to Short Date. Does the cell display as 2/5/2013 or 5/2/2013 ?? ------------------------------------------ If it changes to 5/2/2013, then your windows settings match what your text string shows. if that's the case, then you simply need to edit your cell (A1?) and remove spaces and make sure it ONLY has 18/02/2013 (no quotes or other characters) and make the cell format "Short Date" when you exit the cell, Excel will intrepret the contents as a date, THEN you can add 7. ------------------------------------------ If date changes to 2/5/2013, your Windows system expects dates to be in mm/dd/yyyy format. you have a choice. Do you want the DEFAULT date format to be mm/dd/yyyy or dd/mm/yyyy?? if you change your windows default format to match the date in your text string (dd/mm/yyyy) Excel should recognize your string as a date. ------------------------------------------------------------------- If you DON'T want to change your default format, you need to figure out how to tell Excel that this is a DATE! both the function =DATEVALUE() and =DATE() can be used to do that. DATE() wants you to supply the year,month,day for it to calculate the day number. in your string: "18/02/2013" located in A1 YEAR is =Right(A1,4) Month is =Mid(A1,4,2) Day is =Left(A1,2) giving you: =DATE(RIGHT(A1,4),MID(A1,4,2),LEFT(A1,2)) then, simply add your 7 days: =DATE(RIGHT(A1,4),MID(A1,4,2),LEFT(A1,2))+7 =DATEVALUE is similar to DATE(), but it expect you to assemble a "string" that is a date IN THE FORMAT YOUR SYSTEM RECOGNIZES =========================================================== I know this is long, and has WAY too many options, But really... how it's handled is up to you. we could give you a fairly simple "fix", but that doesn't fix the overall problem. once you understand what Excel is TRYING to do, you'll be able to handle giving it what it needs to act as you expect. let me know if you need more. Paul ----------------------------------------- “Do all the good you can, By all the means you can, In all the ways you can, In all the places you can, At all the times you can, To all the people you can, As long as ever you can.” - John Wesley ----------------------------------------- ________________________________ From: Kuldeep Singh <naukrikuld...@gmail.com> To: excel-macros@googlegroups.com Sent: Thu, February 21, 2013 5:31:24 AM Subject: Re: $$Excel-Macros$$ Date Format query....... I am already try this =A1+7. this is not working. because date format is dd/mm/yyyy Regards, Kuldeep Singh Info Edge India Limited (naukri.com) Phone.: +91-0120-4841100, Extn.: 2467, 9716615535 naukrikuld...@gmail.com || www.naukri.com Please Consider the environment. Please don't print this e-mail unless you really need to. On Thu, Feb 21, 2013 at 3:57 PM, The Viper <viper....@gmail.com> wrote: assuming your date is in a1=a1+7 > > > >On Thu, Feb 21, 2013 at 3:52 PM, Kuldeep Singh <naukrikuld...@gmail.com> wrote: > > >>Hi All, >> >> >>One instant query. my format is 18/02/2013 & I want to add 7 days. Please >>help.... >> >>Regards, >> >>Kuldeep Singh >>Info Edge India Limited (naukri.com) >>Phone.: +91-0120-4841100, Extn.: 2467, 9716615535 >>naukrikuld...@gmail.com || www.naukri.com >>Please Consider the environment. Please don't print this e-mail unless you >>really need to.-- >> >>Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s >>=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ >>https://www.facebook.com/discussexcel >> >>FORUM RULES >> >>1) Use concise, accurate thread titles. Poor thread titles, like Please Help, >>Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not >>get >>quick attention or may not be answered. >>2) Don't post a question in the thread of another member. >>3) Don't post questions regarding breaking or bypassing any security measure. >>4) Acknowledge the responses you receive, good or bad. >>5) Jobs posting is not allowed. >>6) Sharing copyrighted material and their links is not allowed. >> >>NOTE : Don't ever post confidential data in a workbook. Forum owners and >>members >>are not responsible for any loss. >>--- >>You received this message because you are subscribed to the Google Groups "MS >>EXCEL AND VBA MACROS" group. >>To unsubscribe from this group and stop receiving emails from it, send an >>email >>to excel-macros+unsubscr...@googlegroups.com. >>To post to this group, send email to excel-macros@googlegroups.com. >>Visit this group at http://groups.google.com/group/excel-macros?hl=en. >>For more options, visit https://groups.google.com/groups/opt_out. >> >> >> >-- >Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s >=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ >https://www.facebook.com/discussexcel > >FORUM RULES > >1) Use concise, accurate thread titles. Poor thread titles, like Please Help, >Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get >quick attention or may not be answered. >2) Don't post a question in the thread of another member. >3) Don't post questions regarding breaking or bypassing any security measure. >4) Acknowledge the responses you receive, good or bad. >5) Jobs posting is not allowed. >6) Sharing copyrighted material and their links is not allowed. > >NOTE : Don't ever post confidential data in a workbook. Forum owners and >members >are not responsible for any loss. >--- >You received this message because you are subscribed to the Google Groups "MS >EXCEL AND VBA MACROS" group. >To unsubscribe from this group and stop receiving emails from it, send an >email >to excel-macros+unsubscr...@googlegroups.com. >To post to this group, send email to excel-macros@googlegroups.com. >Visit this group at http://groups.google.com/group/excel-macros?hl=en. >For more options, visit https://groups.google.com/groups/opt_out. > > > -- -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros?hl=en. For more options, visit https://groups.google.com/groups/opt_out.