Sorry, I did not realise that you wanted to actually replace the earlier formula. Note that your formula (& my previous suggestion too) will only work if there is always at least one cell in G4:G264 that contains the same value as I2. Will that always be the case for you?I reach solution: =COUNTA(UNIQUE(FILTER($H$4:$H$264,$G$4:$G$264=I2))), but could you give me answer with older versions? So that same result was reached..
Try this (also works if no cells in column G match I2)could you give me answer with older versions?
=SUMPRODUCT(--($G$4:$G$264=I2),--(MATCH($G$4:$G$264&"|"&$H$4:$H$264,$G$4:$G$264&"|"&$H$4:$H$264,0)=ROW($G$4:$G$264)-ROW(G$4)+1))