Google-sheets – Google Spreadsheet: SUM(FILTER( with condition1 and condition2) syntax

google sheets

I need to use FILTER() to sum some cells only if two conditions are TRUE.
This code works for one condition =sum(filter(H4:H, regexmatch(G4:G, "TextA")) but I can't get it to work on two condition:=sum(filter(H4:H, regexmatch(I4:I, "TextA") + regexmathch(J4:J, "TextB")))

My code should sum all the cells from H(starting in H4) only if in the row, this cell, the column I and J contain TextA and TextB respectively.

Best Answer

You don't need to use FILTER(), this looks like the perfect case for SUMIFS().

=sumifs(H1:H6, I1:I6, "TextA", J1:J6, "TextB")

enter image description here