Search code examples
if-statementgoogle-sheetstextsumnumbers

Google Sheets - IF columns contains text and another columns contains number return total value of number column


I am trying to see if I am able to get the hours from one column only if it matches a word that is another column.

For example in the sheet link attached, if the word is Operations (Column A) I want to get the sum of all the hours (Column B) that correlate with that word.

https://docs.google.com/spreadsheets/d/1-1QCZsNTZ5xDcDryv8qg0YPtsoY3Erjz7ZNGUXds7HY/edit

Hope this makes sense.

Thanks in advance.


Solution

  • you can use:

    =SUM(IFNA(FILTER(B:B,A:A=E1)))
    

    OR

    =SUMIF(A:A,E1,B:B)
    
    • Cell E1 has the word selection in the sample here

    enter image description here