google-sheetsgoogle-sheets-formula

Sum columns if text in another column matches


My sheet has a column of numbers and a column of text.

I would like to have the sum of the numbers in column where the corresponding text in the text column matches a string.

The following formula doesn't work:

=SUM(IF(REGEXMATCH(M1:M,"Target-String"), I1:I ,0))

Solution

  • I'm writing this answer as a community wiki since the solution was provided by @user11222393 in the comments section.

    =sumif(M:M,"Target-String",I:I)
    

    enter image description here

    Reference: