Forum Discussion

Zdenek_Moravec's avatar
Zdenek_Moravec
Brass Contributor
Mar 10, 2021
Solved

Count values with max date in filtered excel table

Dear colleagues I still record Covid tests in an excel table Name Test Result Test date Alan negative 01.01.2021 Bred negative 01.01.2021 Alan positive 01.02.2021 Cindy posi...
  • SergeiBaklan's avatar
    SergeiBaklan
    Mar 14, 2021

    Zdenek_Moravec 

    Hi Zdenec,

     

    Filtered rows - in Excel there are two functions which could ignore hided rows or columns - SUBTOTAL() and AGGREGATE(). To check if row is hided you need to use one of these functions. There are few variants, here we use AGGREGATE() within helper column.

     

    Empty cell counting - sorry, I didn't think about that. If array is empty FILTER by default returns an error, and COUNTA doesn't care that's error or not, counts it as any other value. We may use third parameters in FILTER which will be returned in case of empty array, check if it is returned and take zero as final result, otherwise count number of values in returned array. Resulting formula

    =LET(
      visible, FILTER( T_Data[Name], T_Data[Helper],-1),
      IF(INDEX(visible,1)<> -1, COUNTA(UNIQUE( visible)), 0)
    )

Resources