#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
Default SUMPRODUCT

I am using excel 2003 and having issues with this formula. What I need is a
count of how many rows contain both condition one from column A and condition
two from column b. The formula I have right now is:

=SUMPRODUCT(--(A1:A5000=C1),--(B1:B5000=C2)

C1 and C2 are my two conditions. Now sometimes I can easily just auto filter
the data and count it and then manually type it but sometimes it is too large
to do this. The reason I mention this is in one case once filtered there is
only 5 rows that match both conditions but the formula returns 518. So I am
wondering if this is the right formula to find what I am truly looking for
cause it sounds to me that I almost need a couple COUNTIF's with a & in the
middle but I can not get that to work either. Thanks for any help
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default SUMPRODUCT

If you are searching for text values and one of those columns (eg B)
could contain blanks, then you might have to do this:

=SUMPRODUCT(--(A1:A5000=C1),--(B1:B5000=C2),--(B1:B5000<""))

Hope this helps.

Pete

On Feb 26, 8:16*pm, Chad Portman
wrote:
I am using excel 2003 and having issues with this formula. What I need is a
count of how many rows contain both condition one from column A and condition
two from column b. The formula I have right now is:

=SUMPRODUCT(--(A1:A5000=C1),--(B1:B5000=C2)

C1 and C2 are my two conditions. Now sometimes I can easily just auto filter
the data and count it and then manually type it but sometimes it is too large
to do this. The reason I mention this is in one case once filtered there is
only 5 rows that match both conditions but the formula returns 518. So I am
wondering if this is the right formula to find what I am truly looking for
cause it sounds to me that I almost need a couple COUNTIF's with a & in the
middle but I can not get that to work either. Thanks for any help


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default SUMPRODUCT

You are on the right track, you may need to force the formula to multiply the
arrays. (I'm assuming you accidentally left off a parenthesis, as your
formula you posted is not valid)
Try:
=SUMPRODUCT((A1:A5000=C1)*(B1:B5000=C2))
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Chad Portman" wrote:

I am using excel 2003 and having issues with this formula. What I need is a
count of how many rows contain both condition one from column A and condition
two from column b. The formula I have right now is:

=SUMPRODUCT(--(A1:A5000=C1),--(B1:B5000=C2)

C1 and C2 are my two conditions. Now sometimes I can easily just auto filter
the data and count it and then manually type it but sometimes it is too large
to do this. The reason I mention this is in one case once filtered there is
only 5 rows that match both conditions but the formula returns 518. So I am
wondering if this is the right formula to find what I am truly looking for
cause it sounds to me that I almost need a couple COUNTIF's with a & in the
middle but I can not get that to work either. Thanks for any help

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 36
Default SUMPRODUCT

Luke M you are my hero. I love you so much right now.

"Luke M" wrote:

You are on the right track, you may need to force the formula to multiply the
arrays. (I'm assuming you accidentally left off a parenthesis, as your
formula you posted is not valid)
Try:
=SUMPRODUCT((A1:A5000=C1)*(B1:B5000=C2))
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Chad Portman" wrote:

I am using excel 2003 and having issues with this formula. What I need is a
count of how many rows contain both condition one from column A and condition
two from column b. The formula I have right now is:

=SUMPRODUCT(--(A1:A5000=C1),--(B1:B5000=C2)

C1 and C2 are my two conditions. Now sometimes I can easily just auto filter
the data and count it and then manually type it but sometimes it is too large
to do this. The reason I mention this is in one case once filtered there is
only 5 rows that match both conditions but the formula returns 518. So I am
wondering if this is the right formula to find what I am truly looking for
cause it sounds to me that I almost need a couple COUNTIF's with a & in the
middle but I can not get that to work either. Thanks for any help

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 964
Default SUMPRODUCT

Your formula is correct (other than the missing parenthesis at the end).

One reason you may see a difference between the formula and the AutoFilter,
is if you have numbers stored as text. SUMPRODUCT will consider the number
123 different than the text string "123". While AutoFilter will treat them
the same.

Another thing to watch out for when using AutoFilter, is if you also have
Freeze Panes activated. The filtered results won't always be scrolled to the
top of the list. So, when the filter is applied, you may only see 5 rows
visible, but more will be revealed if you scroll up.

HTH
Elkar


"Chad Portman" wrote:

I am using excel 2003 and having issues with this formula. What I need is a
count of how many rows contain both condition one from column A and condition
two from column b. The formula I have right now is:

=SUMPRODUCT(--(A1:A5000=C1),--(B1:B5000=C2)

C1 and C2 are my two conditions. Now sometimes I can easily just auto filter
the data and count it and then manually type it but sometimes it is too large
to do this. The reason I mention this is in one case once filtered there is
only 5 rows that match both conditions but the formula returns 518. So I am
wondering if this is the right formula to find what I am truly looking for
cause it sounds to me that I almost need a couple COUNTIF's with a & in the
middle but I can not get that to work either. Thanks for any help



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
Conditional SUMPRODUCT or SUMPRODUCT with Filters Ted M H Excel Worksheet Functions 4 August 14th 08 07:50 PM
SUMPRODUCT Ron@Buy Excel Worksheet Functions 2 November 9th 07 05:01 PM
Help with SUMPRODUCT please : ) Sierra Excel Worksheet Functions 5 November 8th 07 01:04 AM
sumproduct? sumif(sumproduct)? David Excel Worksheet Functions 3 July 13th 07 07:06 PM
sumproduct Rob Excel Worksheet Functions 4 February 13th 06 03:29 AM


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