#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 355
Default Date formatting

Hello
Cell A1 7/1/2007
Cell A2 =month(a1) and returns 7 if I format as "MM" it returns 01. How do
I get this to return 07.
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default Date formatting

=TEXT(A1,"mm")

"Sandy" wrote:

Hello
Cell A1 7/1/2007
Cell A2 =month(a1) and returns 7 if I format as "MM" it returns 01. How do
I get this to return 07.
Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default Date formatting

Hi Sandy,

I used to run in to this as well. Because A2 has a formula to return
month from A1, your value is 7. Since you then are formatting as
month, it is in essence taking 7 as a date, which is 7 January 1900.
That is why you get 01 (if you had set format as "MMM" it would say
"Jan").

To fix this in cell A2, simply make A2=A1, and then set format as
"MMM". You will then get "Jul" in that cell.

Cheers,
Jamison


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional formatting for cell date to equal today's date Sistereinstein Excel Worksheet Functions 2 September 10th 12 07:53 PM
Date Formatting when using & The Rook[_2_] Excel Discussion (Misc queries) 2 March 21st 07 12:10 PM
Date Formatting Des1313 Excel Discussion (Misc queries) 1 March 13th 07 09:23 PM
XML date formatting Richard Roche Excel Worksheet Functions 0 December 6th 05 06:49 PM
date formatting BernieH Excel Discussion (Misc queries) 2 May 30th 05 03:33 PM


All times are GMT +1. The time now is 07:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"