Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
days and months with heading zero from formula
Hi all
I'm using this little formula to create a string that I use to do some further computations =YEAR(C88)&"-"&MONTH(C88)&"-"&DAY(C88) the formula extracts the year,month,day from a date format cell like C88 that is MM/DD/YYYY The problem is that if either the month or day are <10 I do not get the heading zero from the formula. example: C88=01/02/2003 ; my formula gives me a string 2003-2-1 instead of 2003-02-01, which is what I need. Is there any way to add the zero or extract the month and day so that they keep the heading zero? thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
days and months with heading zero from formula
Please try
=TEXT(C88,"YYYY-MM-DD") If this post helps click Yes --------------- Jacob Skaria "abc" wrote: Hi all I'm using this little formula to create a string that I use to do some further computations =YEAR(C88)&"-"&MONTH(C88)&"-"&DAY(C88) the formula extracts the year,month,day from a date format cell like C88 that is MM/DD/YYYY The problem is that if either the month or day are <10 I do not get the heading zero from the formula. example: C88=01/02/2003 ; my formula gives me a string 2003-2-1 instead of 2003-02-01, which is what I need. Is there any way to add the zero or extract the month and day so that they keep the heading zero? thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
days and months with heading zero from formula
Jacob Skaria wrote:
Please try =TEXT(C88,"YYYY-MM-DD") If this post helps click Yes --------------- Jacob Skaria Yes, that worked! Thanks a lot! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Total days worked /20 to get actual months/days | Excel Worksheet Functions | |||
Date formula resulting in Year, Months & days | Excel Worksheet Functions | |||
how do i convert a number of days to years, months & days? | Excel Discussion (Misc queries) | |||
FORMULA FOR CALCULATING YEARS, DAYS, & MONTHS BETWEEN SEVERAL DATE | Excel Discussion (Misc queries) | |||
convert Days to Years, Months, Days | Excel Discussion (Misc queries) |