google-sheetsfiltervlookupsumifsgoogle-query-language

how to search for a cell and grab the next cell data


I have 2 columns. A and B - there is a list of project names and maybe duplicate (which is Ok) in column A. and there is a list of numbers related to that project name in column B.

I want to look for project names and grab the number next to that cell for adding up.

I have searched for different formulas, but none of them could help me.

however this one was better but not complete and working.

=SUM((FIND("projectname",A:A) "here there should be some formula to grab the next cell) and them all )

we may have 10 or 20 duplicate project names, and it's necessary to sum up all numbers next to that project.

Thanks for your time guys.


Solution

  • try any of these:

    =FILTER(B:B; A:A="projectname")
    

    =VLOOKUP("projectname"; A:B; 2; )
    

    =QUERY(A:B; "select Col2 where Col1 = 'projectname'"; )
    

    *any of these can be wrapped into SUM if needed