SUMIF With Or Criteria

Tom Allen

Board Regular
Joined
Sep 26, 2014
Messages
92
Hi I am trying to get a SUMIF formula to work with an Or criteria, but I cant get it to work if the criteria references a cell instead of a static value.

Here is my current code:
Code:
=SUM(SUMIF(A3:A100,{"Apples","Oranges"},K3:K100))

This code works if either Apples or Oranges is found in any cell between the range A3:A100.

However what I am trying to achieve is I want to change Apples to A4 and Oranges to B4, so that the criteria picks up what ever is in cell A4 or B4.

I have tried various things but i cant seem to get it to work when the criteria is one of two cells.

I would be grateful for any assistance.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Thanks for the reply, it works for the B4 criteria but when it finds the criteria in A4 it only ever adds 1 instead of the actual value in column 4.
 
Upvote 0
=SUMPRODUCT(SUMIF(A3:A100,A4:B4,K3:K100))

should work.
 
Upvote 0

Forum statistics

Threads
1,214,936
Messages
6,122,340
Members
449,079
Latest member
rocketslinger

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