How about something like this:

Where Unique Jobs
and Unique Dates
are calculated with:
{=SUM(--(FREQUENCY(IF($A$2:$A$13=A2,$B$2:$B$13),IF($A$2:$A$13=A2, $B$2:$B$13))>0))}
and
{=SUM(--(FREQUENCY(IF($A$2:$A$13=A2,$C$2:$C$13),IF($A$2:$A$13=A2, $C$2:$C$13))>0))}
respectively. Note the formulas are array formulas which means they need to be entered with CTRL + SHIFT + ENTER.
The IF
statement handles the "are you the employee I care about?" aspect and returns an array of jobs or dates. We take advantage of the fact that when we bin with the same array with FREQUENCY
, we return a zero for any value it has already seen. The double negation, --
, coerces the numbers to booleans to ones-and-zeros.
More explanation is available here.
It's likely possible to do this without the FREQUENCY
approach or without array formulas, but depending on the size of the dataset, you might want to consider the performance hit.
UPDATE (per comments):
If you have an additional column, say column D
= Job_Type
, you can add criteria to the IF
condition, like so:
{=SUM(--(FREQUENCY(IF(($A$2:$A$13=A2)*($D$2:$D$13="Job Type X"),$B$2:$B$13),IF(($A$2:$A$13=A2)*($D$2:$D$13="Job Type X"),$B$2:$B$13))>0))}
By utilizing multiplication with an asterisk, *
, we are implicitly implying an AND
condition in the logic; note, if we wanted OR
logic we could use +
. Also note the additional parentheses. At the end of the day, this says, first check if this is the Emp
that I care about; next, check if this is the Job_Type
that I care about; if both of those checkout, return me the column of interest and continue as above.
NOTE: The method just described will make things yield the same results, by employee, for the specified Job Type
-- in this example, records with Job_Type == "Job Type X"
. You could do something like: {=SUM(--(FREQUENCY(IF(($A$2:$A$13=A2)*($D$2:$D$13=D2),$B$2:$B$13),IF(($A$2:$A$13 = A2)*($D$2:$D$13=D2),$B$2:$B$13))>0))}
and you would obtain different productivity amounts for each Emp
and Job_Type
combination.
Alternatively, you could create a new Key
column, such as Emp_Job_Type
which would concatenate the two columns, something like: =A2&D2
.
Finally, if you are only interested in one particular Job_type
, you could also consider subsetting or filtering your data beforehand. That is, filter for the records of interest upfront and create a new dataset.