Forum Discussion
Templar70
Jun 10, 2020Copper Contributor
Sum of Range based on numbers in a different row
Hi, I would appreciate any help I can receive on this spreadsheet, which is being used for tracking employee absence. I am trying to sum the total of a range.(the sum of the hours taken in the month...
- Jun 10, 2020
=SUM((B5:AF5="X")*(B$4:AF$4),B5:AF5)or for older versions of Excel:
=SUMPRODUCT((B5:AF5="X")*(B$4:AF$4),B5:AF5)
Jos_Woolley
Jun 10, 2020Iron Contributor
I think you need to check your second formula with SUMPRODUCT, which does not give correct results in any version of Excel.
Regards
Detlef_Lewin
Jun 10, 2020Silver Contributor
- Jos_WoolleyJun 10, 2020Iron Contributor
Then you must have amended the original values as given by the OP, since it will only be by a very fortunate coincidence that those two formulas produce the same result: SUM sums the arguments passed to it, SUMPRODUCT sums the products of the respective entries in the arguments passed to it.
Regards- Detlef_LewinJun 10, 2020Silver Contributor
Sorry, you are correct.
I thought I posted the correct formula.
This is the correct one:
=SUM(SUMPRODUCT((B5:AF5="X")*(B$4:AF$4)),B5:AF5)- Jos_WoolleyJun 10, 2020Iron Contributor