Home > Mobile >  Excel FILTER & COUNTIF
Excel FILTER & COUNTIF

Time:12-21

Currently, the formula in cell F7 is: =FILTER(C3:C7, COUNTIF($F$3:$F$4, $B$3:$B$7))

However, that formula can only return "Pen" and "Paper". But now I would like it to be when cell G3 is "Price" then 5 and 2 will be returned; if cell G3 is "Item" then "Pen" and "Paper" will be returned

May I know how should I modify the formula in cell F7?

You can have a look at the screenshot attached below to understand my question better. Thanks in advance.

Screenshot

CodePudding user response:

=FILTER(FILTER($B$3:$D$7,$B$2:$D$2=$G$3),COUNTIF($F$3:$F$4, $B$3:$B$7)) It first filters the range to where the column header equals the value in G3, then it filters that column with your countif results.

  • Related