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.
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.
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.
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.
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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With