Search code examples
google-sheetsgoogle-sheets-formulasumifs

SUMIF with VLOOKUP condition


I'm trying to get a SUM of values where the NAME belongs to a specific COMPANY like Microsoft as shown in the example image below. Both Marc and Christian are from Microsoft and the sum of their values should be 115. Note the data will be in 3x different sheets as shown in the example.

I've tried a few different options, including using INDEX/MATCH but I can't figure it out. If anyone can lead me in the right direction I would be very thankful. I've done several searches and even watched videos about SUMIF/SUMIFS, VLOOKUP and INDEX/MATCH to see if I'm missing anything but no success.

Spreadsheet here

enter image description here


Solution

  • Updated Answer:

    =sum(ifna(filter(sumif(VALUES!A:A,COMPANIES!A:A,VALUES!B:B),COMPANIES!B:B=A2)))
    

    enter image description here