Forum Discussion
ohillaryo
Jun 28, 2023Copper Contributor
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??...
Detlef_Lewin
Jun 29, 2023Silver Contributor
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.
ohillaryo
Jun 29, 2023Copper Contributor
Detlef_Lewin ok but for that formula example, it does in fact update the cell count after sorting... i'm trying to do the same but just only if the letter N is present. I don't see why I can count cells in general and have them update after sorting but can't count cells that only contain the letter N and have it update after sorting...
- Detlef_LewinJun 29, 2023Silver Contributor
I will leave this discussion because you keep mentioning "sorting" despite I told at least twice that there is no connection between sorting and counting.