Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default countif on unformatted dates

I have few dates in column A but it starts with an apostrophe sign.
Lets say the range is A1:A9 and here is a sample data
'6/5/2006 11:35:08 AM
'6/5/2006 11:35:08 AM
'6/5/2006 11:35:08 AM
'6/6/2006 11:35:08 AM
'6/6/2006 11:35:08 AM
'6/7/2006 11:35:08 AM
'6/8/2006 11:35:08 AM
'6/9/2006 11:35:08 AM
'6/9/2006 11:35:08 AM

I have the following values in cell A11:A15
6/5/2006
6/6/2006
6/7/2006
6/8/2006
6/9/2006

If I do a countif in cell B11 =COUNTIF(A1:A9,A11), the answer I get is
ZERO

How come???

I know it has got something to do with formats but not sure what. What
would be the correct formula?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Biddulph
 
Posts: n/a
Default countif on unformatted dates

wrote in message
ups.com...
I have few dates in column A but it starts with an apostrophe sign.
Lets say the range is A1:A9 and here is a sample data
'6/5/2006 11:35:08 AM
'6/5/2006 11:35:08 AM
'6/5/2006 11:35:08 AM
'6/6/2006 11:35:08 AM
'6/6/2006 11:35:08 AM
'6/7/2006 11:35:08 AM
'6/8/2006 11:35:08 AM
'6/9/2006 11:35:08 AM
'6/9/2006 11:35:08 AM

I have the following values in cell A11:A15
6/5/2006
6/6/2006
6/7/2006
6/8/2006
6/9/2006

If I do a countif in cell B11 =COUNTIF(A1:A9,A11), the answer I get is
ZERO

How come???

I know it has got something to do with formats but not sure what. What
would be the correct formula?


Your A1 to A9 are text values, forced to that because of the apostrophe.

Without the apostrophe you can hopefully format the cells as date & time.
--
David Biddulph


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default countif on unformatted dates

One possible way using your example


=SUMPRODUCT(--(INT(--SUBSTITUTE($A$1:$A$9,"'",""))=A11))

copy down will give

3
2
1
1
2


--

Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
"It is a good thing to follow the first law of holes;
if you are in one stop digging." Lord Healey


wrote in message
ups.com...
I have few dates in column A but it starts with an apostrophe sign.
Lets say the range is A1:A9 and here is a sample data
'6/5/2006 11:35:08 AM
'6/5/2006 11:35:08 AM
'6/5/2006 11:35:08 AM
'6/6/2006 11:35:08 AM
'6/6/2006 11:35:08 AM
'6/7/2006 11:35:08 AM
'6/8/2006 11:35:08 AM
'6/9/2006 11:35:08 AM
'6/9/2006 11:35:08 AM

I have the following values in cell A11:A15
6/5/2006
6/6/2006
6/7/2006
6/8/2006
6/9/2006

If I do a countif in cell B11 =COUNTIF(A1:A9,A11), the answer I get is
ZERO

How come???

I know it has got something to do with formats but not sure what. What
would be the correct formula?



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default countif on unformatted dates

Thank you very much

Peo Sjoblom wrote:
One possible way using your example
=SUMPRODUCT(--(INT(--SUBSTITUTE($A$1:$A$9,"'",""))=A11))


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
using countif to add dates jwmillzy Excel Discussion (Misc queries) 2 June 2nd 06 06:27 PM
Countif on multiple dates Jim Excel Worksheet Functions 6 December 13th 05 05:56 PM
COUNTIF using Dates WLMPilot Excel Worksheet Functions 1 October 7th 05 12:51 AM
Countif using dates Bugaglugs Excel Worksheet Functions 11 August 23rd 05 05:16 PM
COUNTIF With Multiple Dates, Columns and Text Shannon Excel Worksheet Functions 4 November 26th 04 11:12 PM


All times are GMT +1. The time now is 09:03 AM.

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"