Search code examples
google-sheetsgoogle-sheets-formulasumifs

Sumifs with or conditional in Google Sheets


I have a database and I need to create a sumifs expression in Google sheets with the following rules: I have a range of cells and this would be a filter for what the sumifs must sum (similar to an OR). I think the image will explain a little bit better what my expected result is:

a spreadsheet displaying the result of summing a certain column based on the values of another column

I have been trying with a lot of examples but none of them have given me the right result.


Solution

  • You can filter the values and then sum up:

    enter image description here

    First one would be: =SUM(FILTER($B$1:$B$6;$A$1:$A$6=$F$4:$F$6))

    Second one: =SUM(FILTER($B$1:$B$6;$A$1:$A$6=$I$4:$I$5))

    You can see an example I uploaded to GDrive