Google-sheets – Function to search columns and tally data

formulasgoogle sheetsvlookup

I am wondering if I can write a function to search a column in my spreadsheet for a specific name, then return x number of values within the row(s) that contain the name. For example…

enter image description here

M4 holds the function. The function searches Columns D, G, and J to find a match of the name in L4 (Owen). Owen's name can occur multiple times in following rows. The function returns a cell value, say B4, in M4.

Best Answer

How do I implement a search to continue searching down the column for another instance of the search_key and summate the results

  • paste in M4 cell:

    =COUNTA(IFERROR(QUERY({D:D;G:G;J:J}, "where Col1 contains '"&L4&"'", 0)))*B4