SUMIFS with multiple column criteria range

walkwithred

New Member
Joined
Mar 21, 2014
Messages
4
Hello,

I'm trying to write a SUMIFS formula where the range for the first piece of criteria spans multiple columns as shown in the example formula below:

=SUMIFS(Sheet2!N:N,Sheet2!O:Z,Sheet1!A3)

So the value in A3 on Sheet1 can appear in any column between O and Z in Sheet2 over multiple rows. In addition, the column it appears in can be different for each row.

Have not had any luck getting this to work and would appreciate any suggestions.

Best,

Red
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Control+shift+enter, not just enter:

=SUM(IF(Sheet2!O2:Z400=Sheet1!A3,Sheet2!N2:N400))

This will pick out every occurrence of the condition in O2:Z400 on Sheet2.
 
Upvote 0
Thank you, Aladin.

Is it possible to use AND OR functions in this array as I do need to add additional (single column) criteria, hence the SUMIFS function?
 
Upvote 0
Thank you, Aladin.

Is it possible to use AND OR functions in this array as I do need to add additional (single column) criteria, hence the SUMIFS function?

Yes, that's possible. Example:

=SUM(IF(Sheet2!K2:K400=Sheet1!B3,IF(Sheet2!O2:Z400=Sheet1!A3,Sheet2!N2:N400)))

Note. Trouble is that you can't invoke SumIfs when the terms are not of the the same dimension like multiple columns vs single column.
 
Last edited:
Upvote 0
I've experimented and it seems that the array will not work with multiple conditions (at least as far as I can figure out).

I managed to get the desired result by creating an additional column with the values in columns O through Z concatenated (=O2&" "&P2&" "&etc.) and then using wildcards in the SUMIFS function:

=SUMIFS(Sheet2!N:N,Sheet2!O:O,"*"&Sheet1!A3&"*",Sheet2!G:G,"Condition 2")

Hopefully this will help others in a similiar predicament.

Thanks!
 
Upvote 0
I've experimented and it seems that the array will not work with multiple conditions (at least as far as I can figure out).

I managed to get the desired result by creating an additional column with the values in columns O through Z concatenated (=O2&" "&P2&" "&etc.) and then using wildcards in the SUMIFS function:

=SUMIFS(Sheet2!N:N,Sheet2!O:O,"*"&Sheet1!A3&"*",Sheet2!G:G,"Condition 2")

Hopefully this will help others in a similiar predicament.

Thanks!

Concatanation is ok. However, your judgement regarding array formulas is not:

=SUM(IF(Sheet2!G2:G400="Condition 2",IF(Sheet2!O2:Z400=Sheet1!A3,Sheet2!N2:N400)))
 
Upvote 0
Cheers, Aladin. We posted at the same time.

I see. A nested IF would not have occured to me, such is my limited knowledge of arrays.

Appreciate the time and help :)
 
Upvote 0
Cheers, Aladin. We posted at the same time.

I see. A nested IF would not have occured to me, such is my limited knowledge of arrays.

Appreciate the time and help :)

No problem. You're welcome. A small note involving concatenation:

=A2&"|"&B2

would be better than just

=A2&B2

for 1xy2 does not diffrerentiate 1x and y2 on one hand; 1 and xy2 on the other.
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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