LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default Formatting Dates

That works. Here is a supplemental question for you:

The function works for dates that have double digit months. Single digit
months (January - September) don't have a "0" in front of the month making
the formula return the wrong date.

Example:

4/17/07 is in the spreadsheet as "41707". Due to the cell format, a "0"
is
automatically added. Using =DATE(RIGHT(A1,2),LEFT(A1,2),MID(A1,3,2)) in a
date formatted cell gives me "07/09/10". If I add a "0" in front of
"41707",
it gives me the correct result but since the spreadsheet has about 5,000
rows, I can't readily devote that much time.


This should work for you...

=DATE(YEAR("January 1, " &
RIGHT(A1,2)),LEFT(A1,LEN(A1)-4),MID(A1,LEN(A1)-3,2))

Rick



 
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
Formatting of Dates Hervinder Excel Discussion (Misc queries) 1 June 25th 07 10:35 AM
Formatting Dates Jordan Excel Worksheet Functions 4 February 13th 07 12:31 AM
formatting dates Papa Jonah Excel Worksheet Functions 2 September 13th 05 10:42 PM
Dates Not Formatting as Dates awacs Excel Worksheet Functions 4 September 13th 05 10:35 PM
Formatting dates rovetrader Excel Worksheet Functions 1 February 14th 05 05:03 PM


All times are GMT +1. The time now is 07:04 AM.

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"