=SUM(IF(FREQUENCY(IF(SUBTOTAL(3;OFFSET(Q22;ROW(Q22:Q27)-ROW(Q22);;1));IF(Q22:Q27<>"";MATCH("~"&Q22:Q27;Q22:Q27&"";0)));ROW(Q22:Q27)-ROW(Q22)+1);1))
This formula calculates the number of unique values in the range Q22:Q27.
Here’s how it works:
SUM(number1, [number2], ...)
At our table:
=SUM(IF(FREQUENCY(IF(SUBTOTAL(3;OFFSET(Q20;ROW(Q20:Q24)-ROW(Q20);;1));IF(Q20:Q24<>"";MATCH("~"&Q20:Q24;Q20:Q24&"";0)));ROW(Q20:Q24)-ROW(Q20)+1);1))
2
IF(logical_test, [value_if_true], [value_if_false])
At our table:
IF(FREQUENCY(IF(SUBTOTAL(3;OFFSET(Q20;ROW(Q20:Q24)-
-ROW(Q20);;1));IF(Q20:Q24<>"";MATCH("~"&Q20:Q24;Q20:Q24&"";0)));
ROW(Q20:Q24)-ROW(Q20)+1);1)
1
1
false
false
false
false
FREQUENCY(data_array, bins_array)
At our table:
FREQUENCY(IF(SUBTOTAL(3;OFFSET(Q20;ROW(Q20:Q24)-
-ROW(Q20);;1));IF(Q20:Q24<>"";MATCH("~"&Q20:Q24;Q20:Q24&"";0)));
ROW(Q20:Q24)-ROW(Q20)+1)
3
2
0
0
0
0
SUBTOTAL(function_num,ref1,[ref2],...)
At our table:
SUBTOTAL(3;OFFSET(Q20;ROW(Q20:Q24)-ROW(Q20);;1) |
---|
1 |
1 |
1 |
1 |
1 |
MATCH(lookup_value, lookup_array, [match_type])
Determines the first row in which the value was found. For instance, the number "6" was found first in number "1" row and again in row number "5", but it will show number "1".
At our table:
MATCH("~"&Q22:Q27;Q22:Q27&"";0) |
---|
1 |
2 |
2 |
2 |
1 |
6 |
OFFSET(reference, rows, cols, [height], [width])
At our table:
OFFSET(Q22;ROW(Q22:Q27)-ROW(Q22);;1) |
---|
#VALUE! |
#VALUE! |
#VALUE! |
#VALUE! |
#VALUE! |
#VALUE! |
ROW([reference])
At our table:
ROW(Q22:Q27)-ROW(Q22) OFFSET(ROW(Q22:Q27)-ROW(Q22);;1) ROW(Q22:Q27)-ROW(Q22)+1
0 6 1
1 2 2
2 2 3
3 2 4
4 6 5
5 0 6