I’m working with a spreadsheet that has columns for product codes, prices, category tags, and other details. My goal is to add up all the prices where a specific tag appears in the tags column.
I need to find all rows that contain “METAL” in the categories and sum their prices. The expected result should be 18546.25 (first row + third row).
I’ve been trying VLOOKUP(“METAL”,A2:D4,2) but it keeps returning zero. I also attempted using filter functions but can’t get the right syntax. What’s the correct approach to sum values based on partial text matches in Google Sheets?
VLOOKUP won’t work here since it only finds exact matches, not partial text. Use SUMIF instead: =SUMIF(C:C,"*METAL*",B:B) - this adds up column B wherever column C contains METAL. I hit the same issue analyzing inventory with multiple tags per item. Check your price column for hidden characters or spaces that might mess up the calculation. If there are extra spaces around commas in your categories, run TRIM on that column first.
VLOOKUP won’t work here - it’s built for exact matches, not searching inside comma-separated text. You need SUMIF with wildcards instead: =SUMIF(C:C,"*METAL*",B:B) This scans column C for any cell containing “METAL” and adds up the matching values from column B. The asterisks grab everything before and after “METAL”. Had the same issue with sales data last year - wildcards solved it perfectly for my product tags. Just watch out for text formatting in your price column that might mess up the sum. Got headers? Use =SUMIF(C2:C100,"*METAL*",B2:B100) instead.
sumifs is def better if u got more conditions. also, watch out for weird formats or spaces in ur categories column - those can mess with wildcards. had that problem with product lists too, so TRIM was a lifesaver. clean it up first and ur formula should work!