I am very stuck with this. I have two tables:
Table 1: Patients and CPT values that all say SURG
| PATNO | CPT | ||
| 58903 | SURG | ||
| 58903 | SURG |
Table 2: Has same patients but with actual codes I need to match with Table 1.
| PATNO | CPT | ||
| 58903 | 29882 | ||
| 58903 | 6447 |
The issue: Vlookup only gets first lookup value and I need to populate all the occurrences, not just the first. For Patient 58903, I would like my vlookup to populate the first instance with 29882 and the second with 6447 if possible. I was thinking I could do this easier with SQL? Maybe a left join with a condition but I'm not quite sure how. Any help would be very, very appreciated.