oreo haven
Board Regular
- Joined
- May 15, 2008
- Messages
- 65
I have a report coming from a multi-value database that I am trying to rearrange.
I have almost no experience using Index and Match, but reading up, it seems like the logical step, if I can wrap my hear around building the correct arrays.
My starting data looks like this:
<tbody>
</tbody>
After copying and pasting Unique values from Column A, I would like to use formulas or VBA so that the results are like the following. I thought I could just throw it all into a PiVot Table, but it didn't quite work out. Is INDEX, MATCH the correct route? So, the KEY has to match, and there isn't always going to be data for some of the other columns like CPNUM. Any ideas would be greatly appreciated. I can just use a VLOOKUP for the date, because every instance will be the same. But the formulas in C2 through G2 have me at a loss.
<tbody>
</tbody>
I have almost no experience using Index and Match, but reading up, it seems like the logical step, if I can wrap my hear around building the correct arrays.
My starting data looks like this:
KEY | ENTRY_DATE | INDEX_CODE | INDEX_DATA |
2947002 | 4/24/19 | INV.NO | 2019EPI0044 |
2947002 | 4/24/19 | PO.NO | 223882 |
2947002 | 4/24/19 | VENDOR.NO | 9502 |
2947002 | 4/24/19 | REC.NUM | 372347 |
2947000 | 4/24/19 | INV.NO | 2019EPI0042 |
2947000 | 4/24/19 | PO.NO | 223879 |
2947000 | 4/24/19 | VENDOR.NO | 9502 |
2947000 | 4/24/19 | REC.NUM | 372349 |
2947001 | 4/24/19 | INV.NO | 2019EPI0043 |
2947001 | 4/24/19 | PO.NO | 223880 |
2947001 | 4/24/19 | VENDOR.NO | 9502 |
2947001 | 4/24/19 | REC.NUM | 372348 |
2947001 | 4/24/19 | CPNUM | CP104753 |
<tbody>
</tbody>
After copying and pasting Unique values from Column A, I would like to use formulas or VBA so that the results are like the following. I thought I could just throw it all into a PiVot Table, but it didn't quite work out. Is INDEX, MATCH the correct route? So, the KEY has to match, and there isn't always going to be data for some of the other columns like CPNUM. Any ideas would be greatly appreciated. I can just use a VLOOKUP for the date, because every instance will be the same. But the formulas in C2 through G2 have me at a loss.
KEY | ENTRY_DATE | INV.NO | PO.NO | VENDOR.NO | REC.NUM | CPNUM |
2947002 | 4/24/2019 | 2019EPI0044 | 223882 | 9502 | 372347 | |
2947000 | 4/24/2019 | 2019EPI0042 | 223879 | 9502 | 372349 | |
2947001 | 4/24/2019 | 2019EPI0043 | 223880 | 9502 | 372348 | CP104753 |
<tbody>
</tbody>