add leading 0 for single month return

C

Cam

Hello,

I got a date field and calculate the month out of that date field using
=MONTH(Date) and it returns the month,for example 6/15/07 (return 6) and
11/20/07 (11),
how do I tell it to return 06 instead of 6 on the single digit month.
 
R

Ron Coderre

If you only want to *display* the leading zero
try this:

From the Excel Main Menu:
<format><cells><number tab>
Category: Custom
Type: 00
Click the [OK] button

Alternatively, this formula actually creates a 2-character *text* string:
=TEXT(MONTH(A1),"00")

Does that help?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)
 
Top