How to sum up a specific colum from a range of columns using different criterias

Spiru

Board Regular
Joined
May 10, 2016
Messages
68
Hello,

I have the below two sheets Sheet 1 and Sheet 2 ( the one with the VALUE error) and in Sheet2 I'm trying to obtain the sum of the totals from Sheet1 using a formula with multiple criteria. E.g. I want to see in Sheet2 the results of all the Vichy, Xerolys and Home but only for a specific column: If in Sheet2 in cell A1 I have number 5 then I want the formula to add up the totals from the column corresponding to 5 in Sheet1 ( 87, 14, 26). The formula that I've tried to use is #=SUMIFS(Sheet1!$B$5:$F$7,Sheet1!$A$5:$A$7,Sheet2!A4,Sheet1!$B$3:$F$3,Sheet2!$A$1)# but I receive a VALUE error. Can anyone help?

Thank you,

Sheet1

12345
Vichy 4543566587
Xerolys 23436589914
Home1345655657626

<colgroup><col width="64" span="6" style="width:48pt"> </colgroup><tbody>
</tbody>


and

Sheet2

5
Total
Vichy #VALUE!
Xerolys
Home

<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>
</tbody>
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
In B3 of Sheet2 enter and copy down:

=SUMIFS(INDEX(Sheet1!B:F,0,MATCH($A$1,INDEX(Sheet1!B:F,1,0),0),Sheet1!A:A,$A3)

where A1 = 5 and A3 = Vichy.
 
Upvote 0
Hi Aladin,

Thanks for your replay. I've entered the formula, but It says that I've entered too many arguments for this function

=sumifs(index(Sheet1!B:F,0,match(Sheet2!$A$1,Index(Sheet1!B:F,3,0),0),Sheet1!A:A,Sheet2!A4)

where A1 = 5 and A4 = Vichy
 
Upvote 0
thanks a lot! It works :) it was missing a parenthesis

=SUMIFS(INDEX(Sheet1!B:F,0,MATCH(Sheet2!$A$1,INDEX(Sheet1!B:F,3,0),0)),Sheet1!A:A,Sheet2!A4)
 
Upvote 0
Can you use something like this. Hope this helps.


Excel 2012
ABCDEF
1abcde
2Vichy45.0043.0056.0065.0087.00
3Xerolys23.0043.0065.00899.0014.00
4Home50.0065.00565.0076.0026.00
5
6e
7
8127
Sheet1
Cell Formulas
RangeFormula
B8{=SUM(IF($B$1:$F$1=$A$6,$B$2:$F$4))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Can you use something like this. Hope this helps.

Excel 2012
ABCDEF
1abcde
2Vichy45.0043.0056.0065.0087.00
3Xerolys23.0043.0065.00899.0014.00
4Home50.0065.00565.0076.0026.00
5
6e
7
8127

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Array Formulas
CellFormula
B8{=SUM(IF($B$1:$F$1=$A$6,$B$2:$F$4))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>

Hi Mike,

Sorry for the late replay and thanks for replaying to my question. Your formula sums up all the amounts for the column from B1 to F1 that matches cell A6 for Vichy Xerolys and Home and I needed to sum up the amounts just for all the Vichy or all Home or all Xerolys within that column. So I needed to search based on two criterias : 1. that the column from B1 to F1 matches cell A6 and 2. that the row from A2 to A4 matches Vichy or that it matches Xerolys or Home. Aladin's formula works :).

Thanks again!
 
Upvote 0
Whenever a range-processing formula (ones with SUMIFS and kindred functions) applies and is appropriate, an array-processing formula should be avoided.
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,681
Members
449,116
Latest member
HypnoFant

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