address function within countif function in excel

Viewed 26

I'm trying to use the countif function to count the number of unique values in a list

Something like this worked fine

=SUMPRODUCT(1/COUNTIF(D27:H27,D27:H27))

but when I try to alter the array which I check by doing this

=SUMPRODUCT(1/COUNTIF($D27:ADDRESS(ROW($D27),COLUMN($D27)+VRES-1),$D27:ADDRESS(ROW($D27),COLUMN($D27)+VRES-1)))

where vres is another cell with a constant.

excel tell me there is a problem with the formula but I can figure out where it is. The address function works by itself in its own cell, but doesn't seem to work in the countif function

0 Answers
Related