I'm trying to find a formula that can help me in a problem.
This formula should SUM (or work) with every cell that is near (always on the left) a cell that has the same name. Like below:
Consider every capital letter as a "recipe" and every lowercase letter as an "ingredient". To the left of every ingredient there's a number that indicates the amount of ingredient needed in that recipe.
At the left of the table there's the list of the ingredients.
Using COUNTIF i can know how many recipes have the same ingredients, but i'm searching something to sum (or multiply, it's the same once i understood the process) every left value of the same ingredient.
As you can see i can't use SUMIF (or SUM(FILTER()) ) since for example the element "b" can be found on the 3rd and 5th column and they're not on the same column.
I tried to use INDEX() and MATCH(), and could've used also LOOKUP(),VLOOKUP(),HLOOKUP(), but as you can see there are multiple instances of the same element, and the formula returns me only the same value (Also using ROW()-1 doesn't work for the multiple elements).
Now with this little table i can calculate the numbers easily (e.g. i know that element "a" is needed 2+3+2=7 times) but since the real table has 600+ elements between "recipes" and "ingredients" I wondered if there was a way to do this.
I'm working on OpenOffice but I have no problem on using Excel.
Thank you for your answers.


SUMIF()results from the 3 different columns? - MarcSUMIF()result of every column and work with that. I'm still wondering if there's a way to 1. search every "a" element, 2. subtract 1 at the row value, 3. pick the number and sum it with the next value (repeating 1. and 2. to search the values) - IztooiCOUNTIF()formula using the nearby criteria ("a", "b", "c"...) and the table range. I totally didn't mean to use that in the final formula, but in the end the column translation is"how many recipes use the listed ingredient?". Sorry for the misunderstanding. - Iztooi