Countif cells two rows in corresponding columns
Try this:
B1:F1 = column headers
A2:A7 = row headers
B2:F7 = schedule matrix
A12 = first employee name
B12 = second employee name
=SUMPRODUCT(--(INDEX(B2:F7,MATCH(A12,A2:A7,0),)=INDEX(B2:F7,MATC H(B12,A2:A7,0),)))
--
Biff
Microsoft Excel MVP
"michaelberrier" wrote in message
...
I have a schedule that lists personnel as the row heading and dates as
the column headings that form a grid that lists the shifts the employ
works on a particular date. The shifts are labeled "A", "B", etc.
I need a formula (I'm guessing countif) that counts the number of
times two employees work together. So, if "Bob" is the label for Row
1 and "Tom" is the label for Row 2, I need to know how many times they
both have the same shift (A, B or C) in the same column during the
month which is listed across 30 columns. I've tried several
variations of countif to no avail.
Thanks,
mb
|