Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sum of specific data in separate Excel sheets

I have the following data in 2 separate sheets:
Sheet1:

    A   B   C   D
a   ff  dd  ff  ee
b   12  10  10  12

Sheet2:

    A   B   C   D
a   ge  ff  ff  ee
b   11  13  14  10

Now I want to write a formula to sum all the values in row 2 which contain ff directly above (i.e. in row 1)

In my example above I want to add (Cell Sheet1[A, b], Sheet1[C, b], Sheet2[B, b], Sheet2[C, b]) which is equal to 49.

like image 270
Am1rr3zA Avatar asked Jun 30 '12 12:06

Am1rr3zA


People also ask

How do you sum data across multiple worksheets with the same cell reference?

Click the tab for the first worksheet that you want to reference. Hold down the Shift key then click the tab for the last worksheet that you want to reference. Select the cell or range of cells that you want to reference. Complete the formula, and then press Enter.

Can you Sumif across multiple tabs?

When the data is spread out in different worksheets in similar ranges of cells, we can add categorize the data by using the SUMIF function across multiple sheets. This can be done by nesting the SUMIF function and the INDIRECT function.

How do I sum multiple rows from different sheets in Excel?

In Excel, the hotkey or shortcut for the AutoSum function is Alt + =. Select a list of data in Excel, then press the Alt + = keys at the same time to add the sum value to the bottom of the list. 1. As indicated in the left screen photo, select multiple columns to AutoSum.


2 Answers

For 2 sheets I'd go with brettdj's suggestion, but, generically, you can perform SUMIF across multiple sheets like this:

=SUMPRODUCT(SUMIF(INDIRECT("'"&sheetlist&"'!A1:D1"),"ff",INDIRECT("'"&sheetlist&"'!A2:D2")))

where sheetlist is a named range containing all the sheet names

like image 155
barry houdini Avatar answered Oct 12 '22 08:10

barry houdini


This is a typical job for SUMIF. As SUMIF isn't natively a 3D function that works accross multiple sheets, you will need a formula such as this one (entered on Sheet1) combining the totals from both sheets

=SUMIF(A1:D1,"ff",A2:D2)+SUMIF(Sheet2!A1:D1,"ff",Sheet2!A2:D2)

Note this question would have been better asked on Super User as it is not programming

like image 38
brettdj Avatar answered Oct 12 '22 08:10

brettdj