I have a spreadsheet (in Google Sheets but would also like this to work in Excel if possible) that has a bunch of formulas using various ingredients. They are in the following format:
How can I create a SUMIF formula that will scan this spreadsheet for a certain value, say "brown sugar" and add the value directly to the right?
I know how to do this on a particular column using the following formula:
=SUMIF(A1:A4,"*brown sugar*",B1:B4)
How can I do this for any column within the spreadsheet? Look for "brown sugar" and add the value to the right together with any other occurrences?
To take it a step further, how can I have a cell in the spreadsheet be my input field?
Would like to be able to enter values using a wildcard and reference that cell (A2 in the below example) in the SUMIF
=SUMIF(A4:A7,A2,B4:B7)
Thank you in advance for any help on this!



