add leading 0 for single month return
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. |
Answer: add leading 0 for single month return
Adding a Leading Zero to a Single Digit Month in Excel
To add a leading zero to a single digit month in Excel, you can use the Code:
TEXT
For example, if your original formula returned 6 for the date 6/15/07, the new formula with the Code:
TEXT I hope that helps! |
add leading 0 for single month return
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) "Cam" wrote in message ... 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. |
All times are GMT +1. The time now is 10:50 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com