Dear Excel Forum Community,
I am using excel to do my invoicing.
In one sheet I have all invoices ("invoices" sheet) and in another sheet I have the details of these invoices ("details" sheet). The invoices have numbers and the projects of which sometimes many make up one invoice have PO numbers.
What I am trying to do is list the PO numbers included in an invoice (information from the details sheet) in a cell next to the invoice number (on the invoices sheet), separated by commas.
So there is invoice PEPSI-JULY-2015. It contains the projects PO20058, PO24824, PO28992, PO298477, PO299338, and so on. (sometimes up to 25, 30 POs in one invoice)
In the "details" sheet I have the invoice number in a column on the left, the items and price and other information including the PO-number in their respective columns next to the invoice number on the left.
VLOOKUP will only look at the first match it finds and return it. I have found ways to look at the 2nd, 3rd and 4th match but I could not replicate it so far. But the real trick here seems to list all those matches in one cell (otherwise it would require way to much space and would clutter the whole invoice sheet of which the purpose is to get an overview, not to have to scroll around forever to see which PO-numbers are linked to an invoice number.
Maybe there is another simpler solution of tweaking my tables than using VLOOKUP or INDEX MATCH to find all matches and list them in one cell - any help is appreciated.
I will attach a generic version of my excel file. I have googled and run my brain until insanity and back to somehow make this work but only had weird or partial (only one PO) results. Mostly just errors.
Thank you very much for looking at it. It seems like a common thing to want so I think it might help others as well. And I would absolutely prefer a function to a VBS as I would like to be able to understand how it works and I have no clue about macros and other things...
(sheets other than the "invoices" and "details" sheet can be ignored - only the sheets "invoices" and "details" are required for this. There are some mistakes in the other sheets from deleting stuff.)
Kind regards
Patrick
Bookmarks