Forum Discussion

ohillaryo's avatar
ohillaryo
Copper Contributor
Jun 28, 2023

Count a Value When Sorted

Hi!  I simply need to count the number of times "N" appears in a column but have it updated to the accurate count once another column is sorted.  Why can't I figure out what is probably pretty easy?????

    • Georges_Vienna's avatar
      Georges_Vienna
      Copper Contributor
      Thank you. Could you also tell me how I can combine two (or more) IF-Sections. In the case at hand I would like to count the number of the combination of "N" in Column A for example and "Y" in Column B for example.
    • ohillaryo's avatar
      ohillaryo
      Copper Contributor
      Ok maybe i'm explaining poorly. I have another formula in another cell written as: =SUBTOTAL(3,B5:B104)

      This formula will count the number of cells present after sorting. For this new formula, I want to do the same thing where it counts the number of cells but ONLY if the cell reads "N". And I want it do count the cells with "N" even after another column has sorted the table so that the number of cells reading N might now be lower....
      • Detlef_Lewin's avatar
        Detlef_Lewin
        Silver Contributor

        ohillaryo 

        I have another formula in another cell written as: =SUBTOTAL(3,B5:B104)

        This formula will count the number of cells present after sorting.


        No. The SUBTOTAL() result does NOT change after sorting.

         

        As for the function SUBTOTAL() take a look at the online help:

        • Function_num     Required. The number 1-11 or 101-111 that specifies the function to use for the subtotal. 1-11 includes manually-hidden rows, while 101-111 excludes them; filtered-out cells are always excluded.

        So you might need function_num 103 instead of 3.

         

Resources