LBTravis

New Member
Joined
Oct 1, 2015
Messages
8
NameDepartmentWages401K
Smith, JohnAdmin10,000200
Lavine, AvrilSales50010
Turner, TedAdmin10010
Fonda, JaneSales75075

<tbody>
</tbody>


I want to use an index match/sum if formula to sum the 401K column. The problem is that my data's columns maybe in a different order but the heading will always be the same. I know this is simple but I'm struggling.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
You need to provide more information. What is the criteria that will determine whether something gets included in the sum? Is the goal to have a SUMIF with a dynamic criteria range, dynamic sum range, or both?
 
Upvote 0
The result should be:
Wages $11,350
401K $ 295

The goal is just to sum anything under the "401K" heading. And same thing to sum the entire "wages" column. The criteria will be the same but I can't use static cell references because these columns may be in different orders.
 
Upvote 0
Sorry for the delay in getting back to you on this. I've duplicated your table as follows:

ABCDEFG
1NameDepartmentWages401kWages11350
2Smith, JohnAdmin10,000200401k295
3Lavine, AvrilSales50010
4Turner, TedAdmin10010
5Fonda, JaneSales75075

<tbody>
</tbody>


In cell G2 I have the following formula:
Code:
=SUM(OFFSET($A$1,1,MATCH(F1,$A$1:$D$1,0)-1,COUNT($C:$C),1))

In cell G3 I have the following formula:
Code:
=SUM(OFFSET($A$1,1,MATCH(F2,$A$1:$D$1,0)-1,COUNT($C:$C),1))

The OFFSET function dynamically assigns the range to the SUM function. The MATCH statement inside the OFFSET determines what column to sum by matching what you're summing (Wages or 401k) to the column header.

The COUNT function allows your table to add rows and have those results included in the sum without having to modify the SUM formula.
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,267
Members
449,075
Latest member
staticfluids

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