0

Say I have 5 column headers that repeat 3 times. Apples, Oranges, Bananas, Grapes, Plums, Apples, Oranges, Bananas...etc. The headers are all in row 2. Underneath (Row 3 - Row 230) each header are counts.

I want to sum all of the counts underneath each column where the header is "Apples".

I'm using this formula: =SUMIF(I2:AW2,"Apples",I3:AW230)

The SUM I get back is off by a large factor. Anyone know what I'm doing wrong?

1 Answer 1

1

use SUMPRODUCT():

=SUMPRODUCT((I2:AW2="Apples")*I3:AW230)

One note to this, if there are any text or errors in I3:AW230 this will error.

if there is text or error we need to resort to an array formula of SUM:

=SUM(IFERROR((I2:AW2="Apples")*I3:AW230,0))

Being an array formula and depending on one's version of Excel this may need to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.


If one has the Dynamic Formula FILTER then they can use:

=SUM(FILTER(I3:AW230,I2:AW2="Apples"))
Sign up to request clarification or add additional context in comments.

1 Comment

There is text. Is there a way to account for this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.