Struggling with SUMIFS or SUMPRODUCT

moogthemoog

Board Regular
Joined
Nov 17, 2004
Messages
51
I'm trying to extract separately the actual and budget (row 5) profit figures from row 7, but by department (row 4).
Because the department is merged across 3 columns (actual, budget, variance), I am not getting a valid return for the budget figures, which are in the 2nd column of each department, but the department is only shown in the 1st column (though merged)

I am struggling with SUMIFS and SUMPRODUCT. I suspect I will need INDEX, MATCH, or OFFSET in conjunction with SUMPRODUCT, but I really am not sure.

Please can anyone help?

Many thanks in anticipation...
Jon

TB extract.xlsx
ABCDEFGHIJKLM
1Actual v Budget
2Aug 2020
3
4Financial RowAdministration - ALAdministration - GGConcreteLaboratory
5 ActualBudgetVar To ActActualBudgetVar To ActActualBudgetVar To ActActualBudgetVar To Act
6Total - Sales£0.00£0.00£0.00£2.87£0.13£2.74(£95,526.23)(£128,436.89)£32,910.66(£120.00)(£1,153.24)£1,033.24
7Net Profit/(Loss)£2,849.50£252.89£2,596.61£79,428.76£74,790.44£4,638.32(£19,106.15)(£14,112.05)(£4,994.10)£9,836.04£11,521.94(£1,685.90)
8
9
10
11Net ProfitActualBudget
12Administration - AL2,849.50-SUMIFS
13Administration - GG79,428.76-SUMIFS
14Concrete(19,106.15)-SUMPRODUCT
15Laboratory9,836.04-SUMPRODUCT
TleCEBITDAActvBudProfitLo
Cell Formulas
RangeFormula
B12:B13B12=SUMIFS($7:$7,$4:$4,$A12,$5:$5,"Actual")
C12:C13C12=SUMIFS($7:$7,$4:$4,$A12,$5:$5,"Budget")
B14:B15B14=SUMPRODUCT(--($5:$5="Actual")*($4:$4=$A14),$7:$7)
C14:C15C14=SUMPRODUCT(--($5:$5="Budget")*($4:$4=$A14),$7:$7)
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

GraH

Well-known Member
Joined
Mar 22, 2020
Messages
708
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Book1
ABCDEFGHIJKLM
1Actual v Budget
2aug/20
3
4Financial RowAdministration - ALAdministration - GGConcreteLaboratory
5ActualBudgetVar To ActActualBudgetVar To ActActualBudgetVar To ActActualBudgetVar To Act
6Total - Sales0002.870.132.74-95526.23-128436.8932910.66-120-1153.241033.24
7Net Profit/(Loss)2849.5252.892596.6179428.7674790.44463.831.999.999.999-19106.15-14112.05-4994.19836.0411521.94-1685.9
8
9
10
11Net ProfitActualBudget
12Administration - AL2849.5252.89
13Administration - GG79428.7674790.44
14Concrete-19106.15-14112.05
15Laboratory9836.0411521.94
Sheet1
Cell Formulas
RangeFormula
B12:C15B12=INDEX($B$7:$M$7,MATCH($A12,$B$4:$M$4,0)+MATCH(B$11,$B$5:$D$5,0)-1)
 

moogthemoog

Board Regular
Joined
Nov 17, 2004
Messages
51
And I thought I was being clever trying to use SUMPRODUCT!!
This is brilliant, thank you so much GraH!

Cheers
Jon
 

Watch MrExcel Video

Forum statistics

Threads
1,129,700
Messages
5,637,887
Members
416,988
Latest member
Ahmed_Yehia

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
Top