I'm looking for a way to compare a text string or cell address to a column of possible matches. Then I want to concatenate notes from every row that has a match, but only if a logical test is true. A UDF would be perfect.
I've seen one from Rick Rothstein mentioned a couple times now, but I can't figure out how to add the logical test that I require. In the table below is an example of what I'm looking for. The values in column A (Item) are irrelevant for my purposes, but I want to compare their cell addresses (text strings) against a lookup table in D1:F7. Column B is an example of the results I'm looking for. Note that item $A$2 is present in D3, but the logical test in E3 returns FALSE so B2 is empty. $A$3 is present in D2 and D5. E2 is TRUE and E5 is FALSE, so only F2 is returned in B3. I hope this makes sense.
<tbody>
</tbody>
I've seen one from Rick Rothstein mentioned a couple times now, but I can't figure out how to add the logical test that I require. In the table below is an example of what I'm looking for. The values in column A (Item) are irrelevant for my purposes, but I want to compare their cell addresses (text strings) against a lookup table in D1:F7. Column B is an example of the results I'm looking for. Note that item $A$2 is present in D3, but the logical test in E3 returns FALSE so B2 is empty. $A$3 is present in D2 and D5. E2 is TRUE and E5 is FALSE, so only F2 is returned in B3. I hope this makes sense.
A | B | C | D | E | F | |
1 | Item | Results | Cell References | Logical Test | Notes | |
2 | 1 | $A$3, $A$5 | TRUE | AA | ||
3 | 2 | AA | $A$2 | FALSE | BB | |
4 | 3 | EE | $A$6 | FALSE | CC | |
5 | 4 | AA | $A$3 | FALSE | DD | |
6 | 5 | EE | $A$4, $A$6, $A$7 | TRUE | EE | |
7 | 6 | EE, FF | $A$7 | TRUE | FF |
<tbody>
</tbody>