Hello,
I need a function to calculate number of distinct values in one column in a filtered range (including blanks)
So far I founf a formula:
=SUMPRODUCT((A1:A30000<>"")/COUNTIF(A1:A30000,A1:A30000&""))
- this works, but I need to tranfer it to application.worksheetfunction and apply it only for (xlCellTypeVisible)
so far I got to something like
but this will not work...
thanks alot!
I need a function to calculate number of distinct values in one column in a filtered range (including blanks)
So far I founf a formula:
=SUMPRODUCT((A1:A30000<>"")/COUNTIF(A1:A30000,A1:A30000&""))
- this works, but I need to tranfer it to application.worksheetfunction and apply it only for (xlCellTypeVisible)
so far I got to something like
Code:
d=application.WorksheetFunction.SumProduct(((range("t_rl[medium]").SpecialCells(xlCellTypeVisible)<> & chr(34) & chr(34))/application.WorksheetFunction.CountIf(range("t_rl[medium]").SpecialCells(xlCellTypeVisible),range("t_rl[medium]").SpecialCells(xlCellTypeVisible) & chr(34) & chr34))))
thanks alot!