Search code examples
google-sheetsfiltersumgoogle-sheets-formulaoffset

SUMIF sum value in next column over


I'm trying to make use of the SUMIF function in Google sheets to sum up points if a cell below it is set to "Excused" However, the condition cell (what will be "Excused") and the points cell, are not in the same column.

The basic SUMIF formula I'm starting with is below

=SUMIF($B$9:$CW$9,$B12:$CW12,"=Excused")

I've tried to illustrate this below. Using ranges that go horizontally across the sheet in rows 9 and 12. If the red cell is set to "Excused", it should sum the blue cell.

enter image description here

With how the formula is, it tries to sum the cell in row 9 but in the same column as the cell with "Excused" in it. But, for example, if B12 has "Excused" in it, I want it to sum C9.

Hopefully, this makes sense. I've done my best to explain it, please ask for clarification if needed.


Solution

  • try:

    =SUM(IFNA(FILTER(C9:CX9; B12:CW12="Excused")))