Dear Excel masterminds.
I have been working on making an invoice database for a company within the family, as they still work with software that 15+ years old. I have pretty much made the database in the following manner:
Sheet1: Contains a list of invoices and their services/items. It is meant to be fully information lookup style so that everything can be extracted from this "database".
Sheet2: Contains a printable format for the invoices. The person working with the document can select the invoice number by a drop down list and then the respective invoice will be listed.
Sheet3: Contains lists of customer adresses and such.
It all turned out nicely when I thought that the company only sold a single service and then a set of items, meaning that I could just make an array of INDEX, MATCH and SMALL functions (along with a bunch of IF statements) to first list all the services and then the items (2 variables). However, I just imported last years invoices to test the document and now it turns out that the services in the company can be categorized in 4 groups and then items. I am trying to work around a way to cleanly list the services on the printable format based on an ordered manner.
To strip everything down to the basics, this is what I have:
- Services are categorized into 4 groups and then there are items as a last group, meaning I have 5 variables. I will call these variables X, Y, Z, V and I.
- In Sheet2 I have cells that count the number of services/items per invoice. The cells count the following: G12 counts X, G13 counts Y, G14 counts Z, G15 counts V and G16 counts I.
- In Sheet2 I have cells B19-B33 (aka 15 cells) that are meant for services and items to be listed in order.
This is what I need:
- Based on the counted values of the variables, I need them to be listed in B19-B33 in the order of X > Y > Z > V > I.
- If there are multiple instances of a service, say 2 instances of X, then I need both instances before proceeding down the ordered list.
- To make an example: If I have 2X, 1Y and 2I, I will need the list to be X#1, X#2, Y#1, I#1, I#2. If I have 1Y, 1V and 3I, I will need the list to be Y#1, V#1, I#1, I#2, I#3.
Anyone think/know if this is possible?
Regards,
Bookmarks