Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Help differentiating numbers and dates

Hi,

I have been given a 2003 Excel worksheet containing just one column of
data. This column contains dates (dd/mm/yyyy) and values. I have
been asked to differentiate the dates from the values as anything
formatted as a date *is* a date and anything formatted as a number
*is* a number.

However, as most of the values would represent a valid date (i.e.
24769 would be 24/10/1967), I can't find a single formula that can
differentiate between the numbers and dates. I've tried sorting,
string lengths, looking for "/" characters and using text and
datevalue combined.

I thought I'd ask here before I have to look through all 220,000
values manually. Is there a way of looking for a format type?

Thanks,
Bernie
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default Help differentiating numbers and dates

Try this a try (change the cell reference, of course)...

=IF(LEFT(CELL("format",A1))="D","It's a date","It's not a date")

--
Rick (MVP - Excel)


wrote in message
...
Hi,

I have been given a 2003 Excel worksheet containing just one column of
data. This column contains dates (dd/mm/yyyy) and values. I have
been asked to differentiate the dates from the values as anything
formatted as a date *is* a date and anything formatted as a number
*is* a number.

However, as most of the values would represent a valid date (i.e.
24769 would be 24/10/1967), I can't find a single formula that can
differentiate between the numbers and dates. I've tried sorting,
string lengths, looking for "/" characters and using text and
datevalue combined.

I thought I'd ask here before I have to look through all 220,000
values manually. Is there a way of looking for a format type?

Thanks,
Bernie


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Help differentiating numbers and dates

Just to add to Rick's suggestion:
=if(and(isnumber(a1),LEFT(CELL("format",A1))="D"), "Date","not a date")

Be aware that this could give a wrong result if the format is changed to a date
(or from a date).

Rick Rothstein wrote:

Try this a try (change the cell reference, of course)...

=IF(LEFT(CELL("format",A1))="D","It's a date","It's not a date")

--
Rick (MVP - Excel)

wrote in message
...
Hi,

I have been given a 2003 Excel worksheet containing just one column of
data. This column contains dates (dd/mm/yyyy) and values. I have
been asked to differentiate the dates from the values as anything
formatted as a date *is* a date and anything formatted as a number
*is* a number.

However, as most of the values would represent a valid date (i.e.
24769 would be 24/10/1967), I can't find a single formula that can
differentiate between the numbers and dates. I've tried sorting,
string lengths, looking for "/" characters and using text and
datevalue combined.

I thought I'd ask here before I have to look through all 220,000
values manually. Is there a way of looking for a format type?

Thanks,
Bernie


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Help differentiating numbers and dates

On Sun, 10 May 2009 20:35:08 -0400, "Rick Rothstein"
wrote:

Try this a try (change the cell reference, of course)...

=IF(LEFT(CELL("format",A1))="D","It's a date","It's not a date")

--
Rick (MVP - Excel)


2 comments:

1. The OP should be aware that changing the format does not force a
recalculation of the formula.

2. Some "date" formats give a result of G. For example, ddd dd/mm/yyyy
--ron
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
Stop dates from showing as numbers - when formated as dates JR Excel Discussion (Misc queries) 1 October 29th 08 04:38 PM
why does dividing numbers give me dates and not numbers? dylan Excel Discussion (Misc queries) 1 June 21st 06 11:40 PM
Differentiating data by year into columns Toon Excel Worksheet Functions 1 February 22nd 06 06:12 PM
differentiating between formulas and values shellshock Excel Discussion (Misc queries) 3 July 7th 05 06:02 PM
differentiating between "and"/"or" in a formula Shooter Excel Worksheet Functions 6 November 4th 04 03:04 PM


All times are GMT +1. The time now is 05:13 PM.

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

About Us

"It's about Microsoft Excel"