Search code examples
google-sheetsformuladashboardanalysis

Data count based on cell value. (gsheet)


We have different product categories mentioned in the c column of the google sheet.

enter image description here

The cell "g2" has each of the category in a dropdown Menu. The cell "G3" shows the Sum of "Nos" present in column D against each category. The cell "g2" also has An option called "All". When "ALL" option is Selected, it does not show any result. I need help with this. I need to see the total of Nos where Category is not Blank when "All" option is selected as the category in the cell "g2", g3 should show me the sum of "Nos" against which category "column D" is not null.

I have no Idea how can this be done. suggest me any other methods if you have something in mind.


Solution

  • Use IF() function then use SUMIFS() inside IF().

    =IF(G2="ALL",SUM(D2:D),SUMIFS(D2:D,C2:C,G2))