I'm trying to assist someone with a large data set. I'm stuck however with a formula that doesn't work. I've used AND(Countif) as I thought that's what was required here when matching 2 ranges but as you can see it's returning FALSE which is clearly incorrect. So the objective here is to take the list of Tom, Harry, Fred and check them against each individual row and see if they appear there.
Secondly, if they do appear in the row, we'll need to return which department they are in (in Column F), so for row 2 it would be Dept 1 because Tom who is on the list works there. At this point I have not found that any row would contain more than one person ie Tom and Harry etc but I can't rule that out, for the sake of this example we'll exclude that possibility. I should also say that the person I'm helping does not have Office 365 and only has Excel 2019 on their computer so I'll try and solve this with that constraint.
Secondly, if they do appear in the row, we'll need to return which department they are in (in Column F), so for row 2 it would be Dept 1 because Tom who is on the list works there. At this point I have not found that any row would contain more than one person ie Tom and Harry etc but I can't rule that out, for the sake of this example we'll exclude that possibility. I should also say that the person I'm helping does not have Office 365 and only has Excel 2019 on their computer so I'll try and solve this with that constraint.
Book4 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | |||
1 | Dept 1 | Dept 2 | Dept 3 | Dept 4 | Existing | Which Dept? | ||||||
2 | Tom | Jane | Mary | Jenny | FALSE | Tom | Harry | Fred | ||||
3 | Jane | Mary | Jenny | Anna | FALSE | |||||||
4 | Pete | Jack | Ken | Tom | FALSE | |||||||
5 | Harry | Joe | Jerry | Pete | FALSE | |||||||
6 | Fred | Kevin | Cosmo | Jenny | FALSE | |||||||
Sheet2 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E2:E6 | E2 | =AND(COUNTIF(A2:D2,$H$2:$J$2)) |