View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default (month) 2 digits in formula

Try it like this:

=IF(B2="","",YEAR(B2)&"-"&TEXT(MONTH(B2),"00")&"-"&$A$1+C2&"AT")


--
Biff
Microsoft Excel MVP


"Bradley" wrote in message
...
Hi! there,

I appreciate if someone can help me to solve this.
I have formula in A2,3,4.. cell like
=IF(B2="","",YEAR(B2)&"-"&MONTH(B2)&"-"&($A$1+C2)&"AT").
0
2009-3-1AT 06-Mar-09 1
2009-3-2AT 07-Mar-09 2
2009-3-3AT 08-Mar-09 3

I want the result to be "2009-03-01AT" instead of "2009-3-1AT".
I have no idea how to format 2 digits in month place.

Thanks in advance

Bradley