Home |
Search |
Today's Posts |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I convert column of dates to Hebrew dates | Excel Discussion (Misc queries) | |||
How do I auto-convert European dates to US dates? | Excel Worksheet Functions | |||
How do I convert dates stored as dates to text? | Excel Discussion (Misc queries) | |||
need to convert list of dates to count no. of dates by week | Excel Worksheet Functions | |||
convert dates stored as text to dates | Excel Programming |