I currently have a table in a layout similar to this:
Quality | Fruit1 | Fruit2 | Fruit3
----------------------------------
Sweet | Apple | Orange | Pear
Firm | Pear | Apple | Watermelon
Sweet | Orange | Pear | Melon
Soft | Banana | Orange | Strawberry
Firm | Apple | Melon | Pear
Sweet | Melon | Pear | Watermelon
(The actual table has many more rows, "qualities" and "fruits", though still only three "Fruit#" columns and the one "Quality" column.)
And am trying to create another table, such that it records (for the above example) the number of occurrences for each fruit per quality:
| Firm | Soft | Sweet
--------------------------------------
Apple | 2 | 0 | 1
Banana | 0 | 1 | 0
Melon | 1 | 0 | 2
Orange | 0 | 1 | 2
Pear | 2 | 0 | 3
Strawberry | 0 | 1 | 0
Watermelon | 1 | 0 | 1
(The qualities and fruits are deliberately sorted in this table.)
I've tried a number of combinations with VLookup, Match, Index and Countif/s, and I feel like I'm missing something blatantly obvious as nothing has worked as yet.
My thought process for the formula would be something like (in the case of counting Apple
occurrences in Firm
rows):
- Check
Quality
forFirm
- Check rows with
Firm
forApple
- If an
Apple
is found, add1
to the count ofFirm:Apple
in the output table.
I would also prefer to avoid functions if possible, though I am unaware if this is even possible with the current layouts.