Forum Discussion
kthersh
Feb 14, 2023Copper Contributor
Adjust a formula to ignore hidden/filtered rows of data
I have a formula already setup to calculate the total occurrences of a unique ID in a column. =SUM(IF(ISNUMBER(A2:A2719)*COUNTIF(A2:A2719,A2:A2719)=1,1,0)) But when I have a filter set on a t...
kthersh
Feb 16, 2023Copper Contributor
I appreciate the follow up question, I have the entire set of data set up as a table and I'm using the menu at the top to apply the filter. So I guess I am filtering right now instead of hiding, I just referenced them as hidden as the row numbers continue.
The issue I'm running into now is that the 4505 I believe is accurate, no true way to verify, so the 5138 the other formulas are giving me at the start seem a bit over inflated.
The issue I'm running into now is that the 4505 I believe is accurate, no true way to verify, so the 5138 the other formulas are giving me at the start seem a bit over inflated.
Patrick2788
Feb 16, 2023Silver Contributor
You could try using the table's structured reference in the formula instead of the range. My formula is checking to see if each value in in the column is visible by using SUBTOTAL. If visible, the formula creates a stack of the IDs, removes dupes, and then returns the ROWS of the unique ID stack.
- kthershFeb 16, 2023Copper ContributorSorry if it's a dumb question, but how do I reference the "Table's structured reference" in the formula?
- Patrick2788Feb 16, 2023Silver ContributorWhile in the formula, select the table's column from the first value to the end. Don't include the header row in the selection.
The syntax is: Table[ColumnName]- kthershFeb 16, 2023Copper ContributorSo:
=SUM(IF(ISNUMBER(Table[A])*COUNTIF(Table[A],Table[A])=1,1,0))
New
=LET(visible,DROP(REDUCE("",Table[A],LAMBDA(a,v,IF(SUBTOTAL(3,v)=0,a,VSTACK(a,v)))),1),ROWS(UNIQUE(visible)))