count - Occurences of a value, based on corresponding value across columns -
i have table in layout similar 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" , "fruits", though still 3 "fruit#" columns , 1 "quality" column.)
and trying create table, such records (for above example) number of occurrences 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 , fruits deliberately sorted in table.)
i've tried number of combinations vlookup, match, index , countif/s, , feel i'm missing blatantly obvious nothing has worked yet.
my thought process formula (in case of counting apple
occurrences in firm
rows):
- check
quality
firm
- check rows
firm
apple
- if
apple
found, add1
count offirm:apple
in output table.
i prefer avoid functions if possible, though unaware if possible current layouts.
with row , column labels set required output , assuming quality
in a1, , firm
output in g1 (using functions!) please try:
=countifs($b:$b,$f2,$a:$a,g$1)+countifs($c:$c,$f2,$a:$a,g$1)+countifs($d:$d,$f2,$a:$a,g$1)
in g2 copied across , down suit.
Comments
Post a Comment