Forum Discussion

sburke8's avatar
sburke8
Copper Contributor
Jun 11, 2021
Solved

Countifs with only unique values

Need help in counting unique values while not double counting.  I know how to count unique values with either a function or filter.  I don't know how to combine the below functions.  The first functi...
  • JMB17's avatar
    Jun 11, 2021

    If you have office 365, then I think this should work. But, your data layout is not very clear - it appears to me that you have some some indicator in Column B that should not be blank, the year is in Column F, vehicle type is in Column H, and the vehicle ID is in Column I:

    CountA(Unique(Filter($I$13:$I$347,($B$13:$B$347<>"")*($F$13:$F$347=B$2)*($H$13:$H$347=$A4))))

    For excel versions prior to 365, but have the countifs function, you could try:
    =SUMPRODUCT(($B$13:$B$347<>"")*($F$13:$F$347=B$2)*($H$13:$H$347=$A4)/COUNTIFS($B$13:$B$347,$B$13:$B$347&"",$F$13:$F$347,$F$13:$F$347&"",$H$13:$H$347,$H$13:$H$347&"",$I$13:$I$347,$I$13:$I$347&""))

Resources