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:
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.
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.