Google Sheets – How to Use Regexmatch Inside Sumproduct

google sheetsregexworksheet-function

This works:

=sumproduct($J$6:$J,($A$6:$A="Order")*($G$6:$G="T8"))

This does not.

=sumproduct($J$6:$J,($A$6:$A="Order")*(Regexmatch($G$6:$G,"T8"))  

produces formula parse error.

This

=regexmatch(G22:G30,"P")

Produces a single value. — it's searching the entire range for a match, and outputs TRUE

This

=arrayFormula(regexmatch(G22:G30,"P"))

produces a column of 9 True false values.

=sumproduct($J$6:$J,($A$6:$A="Order")*(ArrayFormula(Regexmatch($G$6:$G,"T8")))

Also produces a Formula Parse Error.

I'm missing a bit of information. Maybe a byte.

Eventually I want to use more complicated expressions than "P" or "T8"

Best Answer

Please try:

=sumproduct(($J$6:$J)*($A$6:$A="Order")*(regexmatch($G$6:$G,"T8")))