PC Review


Reply
Thread Tools Rate Thread

add leading 0 for single month return

 
 
Cam
Guest
Posts: n/a
 
      2nd Apr 2008
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.
 
Reply With Quote
 
 
 
 
Ron Coderre
Guest
Posts: n/a
 
      2nd Apr 2008
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" <(E-Mail Removed)> wrote in message
news:E86DFFA0-AFEE-4D15-9405-(E-Mail Removed)...
> 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.



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need leading zero for month number is less than 10 alex20850 Microsoft Outlook Form Programming 1 12th Feb 2010 10:03 PM
Find Multiple instances of Single Criterion in Row & Return To a Single Col Sam via OfficeKB.com Microsoft Excel Worksheet Functions 16 10th May 2006 03:00 AM
How can I get my query to return the Month Name instead of the Month number? david.isaacks@mail.va.gov Microsoft Access Queries 3 21st Apr 2006 06:34 PM
Formula to return last day of month for each month in year? StargateFan Microsoft Excel Programming 5 3rd Jan 2006 04:05 AM
Month question - Need leading zero ngaisteve1 Microsoft Excel Discussion 3 15th Jul 2004 04:29 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:53 PM.