View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JWolf JWolf is offline
external usenet poster
 
Posts: 136
Default Converting Dates

You can perform the comparison without doing anything.
If you have 1-Jul-2003 showing in a cell and 7/1/2003 showing in the
edit bar, then what you really have is the value 37803 stored in the
cell. Try formatting it as a number and you will see. Excel
automatically converts dates (when it thinks it sees you typing in a
date) to a serial number: the number of days since 01/01/1900 (1904 on a
few systems). So when you are doing a comparision of two dates, Excel
is really comparing two numbers. So, unless you specifcally formatted a
cell as text before you typed in 1-Jul-2003, Excel is treating the
number as 37803 with a cell format of dd-mmm-yyyy. If you want to
compare numbers it will be much easier to do it the way Excel was
designed, rather than try to trick it into using text for dates.

See Chip Pearson's Web site at: http://www.cpearson.com/excel/topic.htm
He has a number of useful pages about working with dates.

jer101 < wrote:
I have to perform a comparison with dates and I am having a problem with
the format... I hope somebody can help me. Here's the problem
specifics...

The date format shows in the spreadsheet cell as 1-Jul-2003 but it is
really 7/1/2003 when I look up top. I need to know how to get convert
the 7/1/2003 to 1-Jul-2003 as a text format, if that is possible. Then
I will be able to compare it to the date in my other spreadsheet which
is in a text format.




---
Message posted from http://www.ExcelForum.com/