sum from multiple columns based on criteria in multiple columns and embedded in header

r_simpson42

New Member
Joined
Sep 25, 2013
Messages
8
Please see example - I will try to explain, but the visual aid is probably required to understand what I am trying to do:
I have many columns in a spreadsheet and every fourth column has state abbreviations with data in the next and second to next columns. I want to sum up all this data in all the columns based on the state abbreviations in every fourth column and based on the presence of particular information embedded in the header of the columns.

Any suggestions are appreciated!

[TABLE="width: 922"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]CO,KY[/TD]
[TD][/TD]
[TD]CO,KY[/TD]
[TD][/TD]
[TD]CO,IN[/TD]
[TD][/TD]
[TD]CO,IN[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"]Jurisdiction[/TD]
[TD]REF[/TD]
[TD][/TD]
[TD="colspan: 2"]Jurisdiction[/TD]
[TD]REF[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Account:[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]1000 Reclasses[/TD]
[TD] [/TD]
[TD]1000[/TD]
[TD] [/TD]
[TD]1040 Reclasses[/TD]
[TD] [/TD]
[TD]1040[/TD]
[/TR]
[TR]
[TD]icSales[/TD]
[TD][/TD]
[TD]MA[/TD]
[TD] (10,000,000)[/TD]
[TD]17[/TD]
[TD] 100,000,000 [/TD]
[TD]RI[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] 5,164,568 [/TD]
[/TR]
[TR]
[TD]icSales[/TD]
[TD][/TD]
[TD]CA[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] 8,000,000 [/TD]
[TD]MA[/TD]
[TD] 9,500 [/TD]
[TD] [/TD]
[TD] 4,131,654 [/TD]
[/TR]
[TR]
[TD]icSales[/TD]
[TD][/TD]
[TD]IN[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] 80,000,000 [/TD]
[TD]CO[/TD]
[TD] 9,000 [/TD]
[TD] [/TD]
[TD] 41,316,544 [/TD]
[/TR]
[TR]
[TD]icSales[/TD]
[TD][/TD]
[TD]MN[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] 900,000,000 [/TD]
[TD]CA[/TD]
[TD] 50,000,000 [/TD]
[TD] [/TD]
[TD] 464,811,119 [/TD]
[/TR]
[TR]
[TD]icSales[/TD]
[TD][/TD]
[TD]AK[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] 75,000,000 [/TD]
[TD]CT[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] 38,734,260 [/TD]
[/TR]
[TR]
[TD]icSales[/TD]
[TD][/TD]
[TD]IA[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] 1,000,000 [/TD]
[TD]MS[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] 516,457 [/TD]
[/TR]
[TR]
[TD]icSales[/TD]
[TD][/TD]
[TD]OH[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] 78,000,000 [/TD]
[TD]LA[/TD]
[TD] 59,765,412 [/TD]
[TD] [/TD]
[TD] 40,283,630 [/TD]
[/TR]
[TR]
[TD]icSales[/TD]
[TD][/TD]
[TD]PA[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] 68,000,000 [/TD]
[TD]TX[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] 35,119,062 [/TD]
[/TR]
[TR]
[TD]icSales[/TD]
[TD][/TD]
[TD]CT[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] 50,000,000 [/TD]
[TD]MA[/TD]
[TD] 6,000,000 [/TD]
[TD] [/TD]
[TD] 25,822,840 [/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]sum MA for CO = [/TD]
[TD] 125,963,994 [/TD]
[TD][/TD]
[TD="colspan: 3"]Add up all MA as CO is in all headers[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]sum CA for IN = [/TD]
[TD] 514,811,119 [/TD]
[TD][/TD]
[TD="colspan: 3"]Add up only CA where IN is in header[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody><colgroup><col><col><col><col><col><col><col><col><col><col></colgroup>[/TABLE]
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Based on your sample data, I would probably sum each column on it's own (and put the sub-totals off to the side), then sum each sub-total
 
Upvote 0
I was hoping for some ideas that would require less setup and less maintenance - mostly the less maintenance part. Any thoughts...? I wrote formulas all day yesterday and am fresh out of ideas.
 
Upvote 0

Forum statistics

Threads
1,223,897
Messages
6,175,270
Members
452,628
Latest member
dd2

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