LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,045
Default Convert dates

On Tue, 28 Sep 2010 11:45:59 -0700 (PDT), gcotterl
wrote:

On Sep 28, 10:55*am, Ron Rosenfeld wrote:
On Tue, 28 Sep 2010 06:14:28 -0700 (PDT), gcotterl



And what is the result of the =TYPE(cell_ref) that joeu2004 asked you
to report?- Hide quoted text -

- Show quoted text -


================================================= =

C =TYPE(cell_ref) result

06/28/1991 =TYPE(C1) 01/02/1900
06/25/1991 =TYPE(C2) 01/01/1900
05/13/1991 =TYPE(C3) 01/01/1900
06/21/1991 =TYPE(C4) 01/01/1900
06/30/1992 =TYPE(C5) 01/01/1900
11/07/1990 =TYPE(C6) 01/01/1900



G =TYPE(cell_ref) result
09-30-2003 =TYPE(G1) 2
09-30-2003 =TYPE(G2) 1
09-30-2003 =TYPE(G3) 1
09-30-2003 =TYPE(G4) 2
09-30-2003 =TYPE(G5) 2
09-30-2003 =TYPE(G6) 2


OK, this clarifies things.

The problem is that your data is really screwed up.

Excel stores dates as serial numbers where 1 = 1 Jan 1900. Some of
your dates are proper dates (those where the TYPE function returns a
1, or returns 01/01/1900 which represents the same value); and other
of your dates have been stored as TEXT representations of a date.

Excel cannot usually perform proper mathematical or comparison
operations on dates that are stored as TEXT.

For this workbook, the first thing you should do is to be certain that
all of the values that appear as dates, are "real" Excel dates (and by
real I mean they are stored as a number as I described above).

I think the simplest way of doing this will be to select the range of
dates in Column C.

Then from the main menu (or Ribbon), select
Data/Text to Columns
<Next
<Next
Now at Step 3:
Column data Format: Date: MDY
<Finish

Repeat this after selecting the dates in Column G.

The above should convert all of your dates to "real" Excel dates, and
allow you to do comparisons or various mathematical operations.

If you cannot clean up your data before getting it into Excel, you
will need to do this whenever you bring dates into your worksheet.

 
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
How can I convert column of dates to Hebrew dates Joe Golden Excel Discussion (Misc queries) 11 May 14th 23 07:45 PM
How do I auto-convert European dates to US dates? sandi Excel Worksheet Functions 3 January 27th 09 10:33 PM
How do I convert dates stored as dates to text? diamunds Excel Discussion (Misc queries) 5 September 7th 07 05:38 PM
need to convert list of dates to count no. of dates by week neowok Excel Worksheet Functions 13 January 30th 06 03:54 PM
convert dates stored as text to dates lenko Excel Programming 2 December 5th 04 06:30 PM


All times are GMT +1. The time now is 10:49 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"