#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Date and range

Hello All,

Im trying to set build a formula that will count all dates within one
column that match the criteria for another. For example, with the formula
below, all entries on the 2nd of a month in column B with numbers less than
0, or a range of numbers in column D.

=SUMPRODUCT((B2:B65000="02/05/2008")*(D2:D65000<0))

I keep getting a value of 0. The formula below will count all the dates but
I cant get it to work when I add the range for D column.

=COUNTIF(B2:B65000,"02/05")

Also what would be the wildcard entry for the date if I wanted to show all
entries on the 2nd of any month and year.

Hope you can help.

Thanks

Andy

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Date and range

You are trying to compare numbers with a string. Try it this way for
your first formula:

=SUMPRODUCT((B2:B65000=DATEVALUE("02/05/2008"))*(D2:D65000<0))

or:

=SUMPRODUCT((B2:B65000=--"02/05/2008")*(D2:D65000<0))

or:

=SUMPRODUCT((B2:B65000=DATE(2008,5,2))*(D2:D65000< 0))

To answer your second question, try this:

=SUMPRODUCT((DAY(B2:B65000)=2)*(D2:D65000<0))

Hope this helps.

Pete

On Jun 30, 12:48*pm, O2 andy wrote:
Hello All,

Im trying to set build a formula that will count all dates within one
column that match the criteria for another. *For example, with the formula
below, all entries on the 2nd of a month in column B with numbers less than
0, or a range of numbers in column D.

=SUMPRODUCT((B2:B65000="02/05/2008")*(D2:D65000<0))

I keep getting a value of 0. *The formula below will count all the dates but
I cant get it to work when I add the range for D column.

=COUNTIF(B2:B65000,"02/05")

Also what would be the wildcard entry for the date if I wanted to show all
entries on the 2nd of any month and year.

Hope you can help.

Thanks

Andy


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,646
Default Date and range

Try this:
=SUMPRODUCT(--(B2:B65000=DATE(2008,5,2)),--(D2:D65000<0),D2:D65000)
Regards,
Stefi

O2 andy ezt *rta:

Hello All,

Im trying to set build a formula that will count all dates within one
column that match the criteria for another. For example, with the formula
below, all entries on the 2nd of a month in column B with numbers less than
0, or a range of numbers in column D.

=SUMPRODUCT((B2:B65000="02/05/2008")*(D2:D65000<0))

I keep getting a value of 0. The formula below will count all the dates but
I cant get it to work when I add the range for D column.

=COUNTIF(B2:B65000,"02/05")

Also what would be the wildcard entry for the date if I wanted to show all
entries on the 2nd of any month and year.

Hope you can help.

Thanks

Andy

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Date and range

Great... Worked perfectly..

Thanks.

Andy...

"Pete_UK" wrote:

You are trying to compare numbers with a string. Try it this way for
your first formula:

=SUMPRODUCT((B2:B65000=DATEVALUE("02/05/2008"))*(D2:D65000<0))

or:

=SUMPRODUCT((B2:B65000=--"02/05/2008")*(D2:D65000<0))

or:

=SUMPRODUCT((B2:B65000=DATE(2008,5,2))*(D2:D65000< 0))

To answer your second question, try this:

=SUMPRODUCT((DAY(B2:B65000)=2)*(D2:D65000<0))

Hope this helps.

Pete

On Jun 30, 12:48 pm, O2 andy wrote:
Hello All,

Im trying to set build a formula that will count all dates within one
column that match the criteria for another. For example, with the formula
below, all entries on the 2nd of a month in column B with numbers less than
0, or a range of numbers in column D.

=SUMPRODUCT((B2:B65000="02/05/2008")*(D2:D65000<0))

I keep getting a value of 0. The formula below will count all the dates but
I cant get it to work when I add the range for D column.

=COUNTIF(B2:B65000,"02/05")

Also what would be the wildcard entry for the date if I wanted to show all
entries on the 2nd of any month and year.

Hope you can help.

Thanks

Andy



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Date and range

That's good to hear, Andy (I was uncertain about some of your
description). Thanks for feeding back.

Pete

On Jun 30, 1:31*pm, O2 andy wrote:
Great... *Worked perfectly..

Thanks.

Andy...

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
Create a formula in a date range to locate a specific date - ecel util Excel Discussion (Misc queries) 0 February 19th 07 03:03 PM
SUMIF within date range as a function of today()'s date irvine79 Excel Worksheet Functions 8 August 6th 06 05:55 PM
Formula for determining if two date columns fall within specific date range Igottabeme Excel Worksheet Functions 2 April 21st 06 02:50 AM
Formula for determining if two date columns fall within specific date range Igottabeme Excel Discussion (Misc queries) 1 April 20th 06 10:03 PM
How to count dates within a certain range in a column with mutiple date range entries Krisjhn Excel Worksheet Functions 2 September 1st 05 01:59 PM


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