Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default How do I count the number of items that meet 2 criteria?

What I'm trying to do is count how many invoice numbers starting with 6 where
completed by a certain date. I've got a column with the date it was
completed and a column of invoice numbers.

Here's what I have so far:
for the date =COUNTIF(H6:H1000,"<"&AB1)
for the invoice numbers =COUNTIF(C6:C1000,"6*")

I just can't get it where it counts them if the row matchs both.

I'm useing Excel 2003 and I'm not allowed to upgrade it, otherwise I would
use the COUNTIFS function in Excel 2007.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,104
Default How do I count the number of items that meet 2 criteria?

While COUNTIFS is nice, SUMPRODUCT can do the same

=SUMPRODUCT(--(H6:H1000<AB1),--(LEFT(C8:C1000)="6"))

Do not try to use full column references other than in XL 2007
=SUMPRODUCT(--(H:H<AB1),--(LEFT(C:C)="6")) ' No No No

For more details on SUMPRODUCT
Bob Phillips
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
J.E McGimpsey
http://mcgimpsey.com/excel/formulae/doubleneg.html
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"2seas" wrote in message
...
What I'm trying to do is count how many invoice numbers starting with 6
where
completed by a certain date. I've got a column with the date it was
completed and a column of invoice numbers.

Here's what I have so far:
for the date =COUNTIF(H6:H1000,"<"&AB1)
for the invoice numbers =COUNTIF(C6:C1000,"6*")

I just can't get it where it counts them if the row matchs both.

I'm useing Excel 2003 and I'm not allowed to upgrade it, otherwise I would
use the COUNTIFS function in Excel 2007.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default How do I count the number of items that meet 2 criteria?

Try this:

=SUMPRODUCT(--(LEFT(C6:C1000)="6"),--(H6:H1000<AB1))

Note that the LEFT function retruns a TEXT value. If you use a cell to hold
the number criteria 6 then you'd have to coerce it to evaluate as a TEXT
value.

AA1 = 6
AB1 = some date

=SUMPRODUCT(--(LEFT(C6:C1000)=AA1&""),--(H6:H1000<AB1))

--
Biff
Microsoft Excel MVP


"2seas" wrote in message
...
What I'm trying to do is count how many invoice numbers starting with 6
where
completed by a certain date. I've got a column with the date it was
completed and a column of invoice numbers.

Here's what I have so far:
for the date =COUNTIF(H6:H1000,"<"&AB1)
for the invoice numbers =COUNTIF(C6:C1000,"6*")

I just can't get it where it counts them if the row matchs both.

I'm useing Excel 2003 and I'm not allowed to upgrade it, otherwise I would
use the COUNTIFS function in Excel 2007.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 857
Default How do I count the number of items that meet 2 criteria?

Hi,

And you are correct, in 2007 you could do that with

=COUNTIFS(H6:H1000,"<"&AB1,C6:C1000,"6*")

provided the invoice numbers were entered as text.

It all the invoice numbers were entered as numbers and they all had the same
number of digits you could use (in 2007):

=COUNTIFS(B2:B5,"399999",B2:B5,"<500000")

However, if those coditions were not met you might still need to use the
SUMPRODUCT function shown in your earlier responses.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"2seas" wrote:

What I'm trying to do is count how many invoice numbers starting with 6 where
completed by a certain date. I've got a column with the date it was
completed and a column of invoice numbers.

Here's what I have so far:
for the date =COUNTIF(H6:H1000,"<"&AB1)
for the invoice numbers =COUNTIF(C6:C1000,"6*")

I just can't get it where it counts them if the row matchs both.

I'm useing Excel 2003 and I'm not allowed to upgrade it, otherwise I would
use the COUNTIFS function in Excel 2007.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default How do I count the number of items that meet 2 criteria?

That worked. Thank you.

"T. Valko" wrote:

Try this:

=SUMPRODUCT(--(LEFT(C6:C1000)="6"),--(H6:H1000<AB1))

Note that the LEFT function retruns a TEXT value. If you use a cell to hold
the number criteria 6 then you'd have to coerce it to evaluate as a TEXT
value.

AA1 = 6
AB1 = some date

=SUMPRODUCT(--(LEFT(C6:C1000)=AA1&""),--(H6:H1000<AB1))

--
Biff
Microsoft Excel MVP


"2seas" wrote in message
...
What I'm trying to do is count how many invoice numbers starting with 6
where
completed by a certain date. I've got a column with the date it was
completed and a column of invoice numbers.

Here's what I have so far:
for the date =COUNTIF(H6:H1000,"<"&AB1)
for the invoice numbers =COUNTIF(C6:C1000,"6*")

I just can't get it where it counts them if the row matchs both.

I'm useing Excel 2003 and I'm not allowed to upgrade it, otherwise I would
use the COUNTIFS function in Excel 2007.






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default How do I count the number of items that meet 2 criteria?

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"2seas" wrote in message
...
That worked. Thank you.

"T. Valko" wrote:

Try this:

=SUMPRODUCT(--(LEFT(C6:C1000)="6"),--(H6:H1000<AB1))

Note that the LEFT function retruns a TEXT value. If you use a cell to
hold
the number criteria 6 then you'd have to coerce it to evaluate as a TEXT
value.

AA1 = 6
AB1 = some date

=SUMPRODUCT(--(LEFT(C6:C1000)=AA1&""),--(H6:H1000<AB1))

--
Biff
Microsoft Excel MVP


"2seas" wrote in message
...
What I'm trying to do is count how many invoice numbers starting with 6
where
completed by a certain date. I've got a column with the date it was
completed and a column of invoice numbers.

Here's what I have so far:
for the date =COUNTIF(H6:H1000,"<"&AB1)
for the invoice numbers =COUNTIF(C6:C1000,"6*")

I just can't get it where it counts them if the row matchs both.

I'm useing Excel 2003 and I'm not allowed to upgrade it, otherwise I
would
use the COUNTIFS function in Excel 2007.






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
Sum of items in a column if they meet two criteria in another colu vlpckett Excel Worksheet Functions 6 February 12th 09 11:44 PM
How do I count the number of cells that meet multiple criteria? Dianna_P Excel Worksheet Functions 7 November 25th 08 05:00 PM
count cells that meet 2 criteria aimee Excel Worksheet Functions 3 June 18th 08 06:45 PM
Count the number of values in a list that meet certain criteria Fudgy Excel Worksheet Functions 1 May 5th 08 09:23 PM
How do I get the total number of items that meet 2 criteria in Exc Terri Excel Worksheet Functions 1 June 28th 06 10:48 PM


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