SUMPRODUCT OR COUNT(IF ..... IF(

Artorius

Board Regular
Joined
Apr 18, 2006
Messages
176
Two columns of data. Column A = PRODUCT TYPE, COLUMN E = Region

I have a spreadsheet that needs to calculate how many "Onions" (in column A) were sold in say "South West" (in Column E).

I thought I could use....

=SUMPRODUCT(A:A="Onions")*(E:E="South West")

but that does not work.

I then tried .....

{=COUNT(IF(A:A="Onions"),IF(E:E="South West))}

but that failed too.

Any ideas? Thanks.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
SUMPRODUCT does not accept whole column references. Try something like...

=SUMPRODUCT(--(A2:A100="Onions"),--(E2:E100="South West"))

Adjust the range accordingly.

Hope this helps!

Edit: Corrected the formula...
 
Upvote 0
=SUMPRODUCT(--(A1:A1000="Onions"),--(E1:E1000="South West"))

Sumproduct doesn't allow full column referencing.....
 
Upvote 0
Is there any limitation to SUMPRODUCT? I'm wondering if I had 3 columns of data instead of 2 ... if I could do the following?

COLUMN A = Type
COLUMN E = Region
COLUMN F = QUESTION (Y/N)

So.. if I wanted Onions, South West & Y ....

=SUMPRODUCT(--(A1:A1000="Onions"),--(E1:E1000="South West")),(--(F1:F1000="Y"))

I tried it but could not get it to work ... even tried entering as an array with the {} brackets
 
Upvote 0
You have to many parenthesis and one of them is closing off the sumproduct() part before including the 3rd argument:

Try:

=SUMPRODUCT(--(A1:A1000="Onions"),--(E1:E1000="South West"),--(F1:F1000="Y"))
 
Upvote 0
I thought I was in trouble when I started putting brackets everywhere :)

Amazing ... works a treat. Many thanks .....
 
Upvote 0

Forum statistics

Threads
1,217,482
Messages
6,136,905
Members
450,030
Latest member
Adalinda

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top