I've set up a drop-down in B47 from which you can choose from the Dispensary list on Sheet2. To achieve this, I first set up a named range called Disp to cover J3:J75 on Sheet2 (I also set up another named range called D_Price to cover cells K3:K75 on Sheet2, which I will need later). Then in cell B47/C47 on Sheet1 (it's not generally a good idea to merge cells), I clicked on Data | Data Validation | Data Validation and in the Allow box I selected List and in the Source box I typed:
=Disp
This tells Excel to only allow values from that named range. I copied cell B47/C47 down to B51/C51, so each of those cells now has the data validation set up in them.
I put this formula in E47/F47:
which checks to see if either B47 or D47 are blank (and returns a blank if so), and if not it then returns the price from the row on which the dispensary occurs and multiplies the unit price by the number in column D. This is very similar to the VLOOKUP formulae I gave you last time, but uses INDEX/MATCH instead (just because I had defined named ranges as lists rather than tables). This formula is copied down to E51/F51.
The formula in the blue cell (H51) is simply a sum of those cells:
Note that you should use the left-most cell when dealing with merged cells. You can then copy this block of cells down to your other pages (Do you really need so many? It slows the workbook down considerably).
Anyway, I hope this helps - good luck with your project.
Pete
Bookmarks