SUMIFS Dynamic range

LBTravis

New Member
Joined
Oct 1, 2015
Messages
8
I need to sum data for each department. This seems simple but my data's columns are not always in the same order. I'm sure there is a way to find the 'department column in an array then find the wages column and sum particular department names.

It just needs to work with dynamic data.

[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Department[/TD]
[TD]Wages[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Smith, John[/TD]
[TD]Admin[/TD]
[TD]1000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Spalding, Sally[/TD]
[TD]Sales[/TD]
[TD]500[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Clooney, George[/TD]
[TD]Admin[/TD]
[TD]700[/TD]
[TD][/TD]
[TD][/TD]
[TD]Sales[/TD]
[TD]800[/TD]
[/TR]
[TR]
[TD]Revere, Paul[/TD]
[TD]SAles[/TD]
[TD]300[/TD]
[TD][/TD]
[TD][/TD]
[TD]Admin[/TD]
[TD]1700[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Try:

=SUMIFS(INDEX(A:C,0,MATCH("wages",INDEX(A:C,1,0),0)),INDEX(A:C,0,MATCH("department",INDEX(A:C,1,0),0)),"sales")
 
Upvote 0
Thank you soooo much!!

Now what if I want to total the "Wages" column but I don't know what column tha's going to end up in.


The formula I proposed determines itself the wages column (the column range to sum) and the department column (the condition range) automatically.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,620
Latest member
dsubash

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