PC Review


Reply
Thread Tools Rate Thread

CountIf this... but also a date range?

 
 
lavachickie
Guest
Posts: n/a
 
      17th Feb 2007
I'm a fairly light Excel user, which is why this is escaping me.

I'm reporting on some data kept on one sheet. The first task was
simple: out of a column, count the occurences of a certain value,
based on a list of values already on the reporting page. That one's
simple:

=COUNTIF('Credit Cards'!S:S,Counts!A3)

But how do I do this if what I want is to ONLY count cells within a
certain date range? Can you have multiple arguements, or is there
another way to do this?

Let's say I wanted to get THAT number, but only for dates between
1/1/07 and 1/30/07?

Thanks. I've searched high and low and don't get it. =)

 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      17th Feb 2007
=sumproduct((a2:a22>b1)*(a2:a22<=b2))
to count

=sumproduct((a2:a22>b1)*(a2:a22<=b2)*b2:b22)
to sum
--
Don Guillett
SalesAid Software
(E-Mail Removed)
"lavachickie" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm a fairly light Excel user, which is why this is escaping me.
>
> I'm reporting on some data kept on one sheet. The first task was
> simple: out of a column, count the occurences of a certain value,
> based on a list of values already on the reporting page. That one's
> simple:
>
> =COUNTIF('Credit Cards'!S:S,Counts!A3)
>
> But how do I do this if what I want is to ONLY count cells within a
> certain date range? Can you have multiple arguements, or is there
> another way to do this?
>
> Let's say I wanted to get THAT number, but only for dates between
> 1/1/07 and 1/30/07?
>
> Thanks. I've searched high and low and don't get it. =)
>



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      17th Feb 2007
=sumproduct(--(somerange>=date(2007,1,1),
--(somerange<=date(2007,1,30),
--('credit cards'!s1:s100=counts!a3))

if you really wanted just January (including the 31st) of 2007, you could use:

=sumproduct(--(text(somerange,"yyyymm")="200701",
--('credit cards'!s1:s100=counts!a3))

Adjust the ranges to match--but you can't use whole columns (except in xl2007).

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail here:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html

lavachickie wrote:
>
> I'm a fairly light Excel user, which is why this is escaping me.
>
> I'm reporting on some data kept on one sheet. The first task was
> simple: out of a column, count the occurences of a certain value,
> based on a list of values already on the reporting page. That one's
> simple:
>
> =COUNTIF('Credit Cards'!S:S,Counts!A3)
>
> But how do I do this if what I want is to ONLY count cells within a
> certain date range? Can you have multiple arguements, or is there
> another way to do this?
>
> Let's say I wanted to get THAT number, but only for dates between
> 1/1/07 and 1/30/07?
>
> Thanks. I've searched high and low and don't get it. =)


--

Dave Peterson
 
Reply With Quote
 
lavachickie
Guest
Posts: n/a
 
      17th Feb 2007
Wow, thanks so much. I've not used SumProduct but it looks pretty
powerfull! THANKS!

amy

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Countif with a date range Paul Corrado Microsoft Excel Worksheet Functions 2 15th Apr 2010 08:08 AM
COUNTIF by date range problem LoriB Microsoft Excel Worksheet Functions 12 27th Oct 2008 06:18 PM
Countif with date range criteria luisi Microsoft Excel Worksheet Functions 5 28th Mar 2008 05:19 PM
COUNTIF formula with date range =?Utf-8?B?RlBK?= Microsoft Excel Programming 10 23rd Aug 2006 10:38 PM
countif date range =?Utf-8?B?am9l?= Microsoft Excel Worksheet Functions 1 27th Sep 2005 08:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:59 AM.