I am trying to create a UDF for finding unique values combining 2 columns. I have a sheet containing data about the employees of my company. I need to count the number of employees of a specific location. Problem is, some employees appear multiple times on a specific location due to the nature of the dataset. The formula for counting the unique cells is not the problem, I use:
IF(SUMPRODUCT(($A$1:$A1=A1)*($B$1:$B1=B1))>1;0;1)
What I want though is to be able to use this function in other sheets whereby I, or another user chooses the value of the columns in which to search for values.
I tried to write the formula but, since I am fairly new to VB, I cannot think of how to get the $-signs in the formula.
Anyone got an idea or a premade script I could adapt to my own needs?