Here's a fun solution! I was trying to look for an array function that would work, but it's difficult to get an array function that will compare 1 cell against the entirety of the array... but RANK() will! (With conditions).
Conditions:
Range A contains sequentially numbered values from 1 to N (number of records in Range B).
Range B contains all of your data sorted ASCENDING with no blanks.
Your data has to be numeric.
In my trial, I created two named regions each with one column containing the same number of rows. "Counter" contained my sequential numbers, "Data" contained my data. This array function returns the number of unique values:
{=SUM(IF(RANK(data,data,1)=counter,1,0),0)}
The logic is simple... for each item in data, the item is ranked (1, 2, 3, 4, etc) and checked against the counter value. If an item is the same as the item above it, it's a tie so its value does not match the counter.
...where "data" is a Range Name referring to the range you want to use.
Reminder: To enter (or re-enter) an Array formula, you MUST use "Control-Shift-Enter".
I've developed a simple but good example for the use of the above Array formula - where it demonstrates that it can be used to count numbers, text and dates.
As I have your email address, I'll send it to you right away.
Also, for anyone else, please feel free to ask for the file. Simply email me, and I'll send the file via return email.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.