(month) 2 digits in formula

B

Bradley

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
 
T

T. Valko

Try it like this:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top