sumif with range over multiple row and column

Krevis

New Member
Joined
Aug 3, 2016
Messages
5
ABCDEF
12013201420152016
2JamesPeter100formula in question
3PeterJames108formula in question
4MaryPeterJames100formula in question

<tbody>
</tbody>

I can't even think of proper question title. Hope i got it right.

How do I have something like sumif($B$2:$E$4,A2,F:F) where E4 is based on number of year starting from 2013?

So... for criteria of 4 years
James would have 108+100
Peter would have 100+100
but Mary would have 0.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
One rule with SUMIF is that the sum range has to be the same size as the criteria range.
So you can't have it look up the whole column when you are just telling it to consider a small range.

So try this in cell: G2 and then copy it on down.....;

=SUMIF($B$2:$B$4,$A2,$F1:$F3)+SUMIF($C$2:$C$4,$A2,$F1:$F3)+SUMIF($D$2:$D$4,$A2,$F1:$F3)+SUMIF($E$2:$E$4,$A2,$F1:$F3)

There may be a shorter way to make this work, but at least this will work...
 
Upvote 0
In F2 control+shift+enter and copy down:

=SUM(IF(MMULT(($B$2:$E$4=$A2)+0,TRANSPOSE(COLUMN($B$2:$E$4)^0)),$F$2:$F$4))

This approach becomes interesting in case you have more year columns to consider.
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,385
Members
448,956
Latest member
JPav

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