Hello everyone
I have recently acquired a small bar and decided that the Cashier Spreadsheet needed a rather major overhaul (business is too small to justify a POS system). I'm finding that the more time I spend on this, the more I think about the information that I would like to extract and how to go about this, therefore this has become somewhat of a project for me now which I find very interesting (from a delving deep into Excel perspective).
A little background info - The business hours are 3pm-2am. Drinks are cheaper 3pm-6pm (Happy Hour or "HH") after which, drinks revert to regular pricing until closing. Drinks are allowed to be purchased for staff members at an increased price. So, the cost of the drink depends on three factors:
Visually, the spreadsheet looks like this:
Excel 2010
<tbody>
</tbody>Data Entry
Field Explanation:
Column A - Formatted as 24hr and manually entered.
Column B - Receipt No and manually entered.
Column C - Cell drop down list (Data list on separate worksheet 'Background Data')
Column D - Cell drop down list (Data list on separate worksheet 'Background Data')
Column E - Contains the formula in question (Posted below). This formula determines the time, Category and type of drink in order to determine the Unit Price.
Column F - Manually entered.
Column G - Simple formula to calculate the Total Unit Cost.
Below is the spreadsheet with the formulas shown:
Excel 2010
<tbody>
[TD="align: center"]2[/TD]
[TD="align: center"]Time[/TD]
[TD="align: center"]Order No[/TD]
[TD="align: center"]Category[/TD]
[TD="align: center"]Item[/TD]
[TD="align: center"]Unit Price[/TD]
[TD="align: center"]Qty[/TD]
[TD="align: center"]Total Unit Cost[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]16:15[/TD]
[TD="align: center"]0001[/TD]
[TD="align: center"]Customer Drink[/TD]
[TD="align: center"]SML[/TD]
[TD="align: center"]75[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]75[/TD]
</tbody>
[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<tbody>[TR="bgcolor: #DAE7F5"]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]E4[/TH]
[TD="align: left"]=IF(D4="","",IF(AND(A4>0.583333,A4<0.75,'Data Entry'!C4="Customer Drink"),VLOOKUP(D4,'Price List'!$A$3:$E$123,3,FALSE),IF(AND(A4>=0.75,A4<0.999999,C4="Customer Drink"),VLOOKUP(D4,'Price List'!$A$3:$E$123,2,FALSE),IF(AND(A4>=0,A4<0.25,C4="Customer Drink"),VLOOKUP(D4,'Price List'!$A$3:$E$123,2,FALSE),IF(AND(A4>0.583333,A4<0.75,'Data Entry'!C4="LD"),VLOOKUP(D4,'Price List'!$A$3:$E$123,5,FALSE),IF(AND(A4>=0.75,A4<0.999999,C4="LD"),VLOOKUP(D4,'Price List'!$A$3:$E$123,4,FALSE),IF(AND(A4>=0,A4<0.25,C4="LD"),VLOOKUP(D4,'Price List'!$A$3:$E$123,4,FALSE),IF(C4="Party Animal",VLOOKUP(C4,'Price List'!$A$3:$E$123,2,FALSE),IF(C4="RTB",VLOOKUP(C4,'Price List'!$A$3:$E$123,2,FALSE),IF(C4="Tossed Balls",VLOOKUP(C4,'Price List'!$A$3:$E$123,2,FALSE),IF(C4="Shirt",VLOOKUP(C4,'Price List'!$A$3:$E$123,2,FALSE),IF(C4="Beer Wrap",VLOOKUP(C4,'Price List'!$A$3:$E$123,2,FALSE),IF(C4="Towel",VLOOKUP(C4,'Price List'!$A$3:$E$123,2,FALSE),IF(C4="Key Chain",VLOOKUP(C4,'Price List'!$A$3:$E$123,2,FALSE),""))))))))))))))[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]G4[/TH]
[TD="align: left"]=IF(E4="", "", F4*E4)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
A sample of the 'Price List' worksheet which is referenced within the VLOOKUP functions:
Excel 2010
<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"][/TD]
[TD="align: center"]Cust Reg[/TD]
[TD="align: center"]Cust HH[/TD]
[TD="align: center"]LD Reg[/TD]
[TD="align: center"]LD HH[/TD]
[TD="align: center"]2[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]3[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]4[/TD]
[TD="align: right"] 160 [/TD]
[TD="align: right"] 135 [/TD]
[TD="align: right"] 215 [/TD]
[TD="align: right"] 195 [/TD]
[TD="align: center"]5[/TD]
[TD="align: right"] 160 [/TD]
[TD="align: right"] 135 [/TD]
[TD="align: right"] 215 [/TD]
[TD="align: right"] 195 [/TD]
[TD="align: center"]6[/TD]
[TD="align: right"] 160 [/TD]
[TD="align: right"] 135 [/TD]
[TD="align: right"] 215 [/TD]
[TD="align: right"] 195 [/TD]
[TD="align: center"]7[/TD]
[TD="align: right"] 160 [/TD]
[TD="align: right"] 135 [/TD]
[TD="align: right"] 215 [/TD]
[TD="align: right"] 195 [/TD]
[TD="align: center"]8[/TD]
[TD="align: right"] 95 [/TD]
[TD="align: right"] 75 [/TD]
[TD="align: right"] 150 [/TD]
[TD="align: right"] 135 [/TD]
[TD="align: center"]9[/TD]
[TD="align: right"] 95 [/TD]
[TD="align: right"] 75 [/TD]
[TD="align: right"] 150 [/TD]
[TD="align: right"] 135 [/TD]
</tbody>
One will notice that there are other items referenced in the formula within 'Data Entry'C4 such as "Party Animal" and "Shirt", these are items that are sold for a singular price regardless of whether they are for a customer or staff - These non dependant items are causing their own problem i.e. If "Shirt" is selected from the drop down list in cell C4 for some reason the price will not be looked up unless something from the drop down list in cell D4 is selected (which should not be required).
So, guys and gals, any suggestions on simplifying the well nested IF formula in cell E4?
Any assistance will be greatly appreciated.
I have recently acquired a small bar and decided that the Cashier Spreadsheet needed a rather major overhaul (business is too small to justify a POS system). I'm finding that the more time I spend on this, the more I think about the information that I would like to extract and how to go about this, therefore this has become somewhat of a project for me now which I find very interesting (from a delving deep into Excel perspective).
A little background info - The business hours are 3pm-2am. Drinks are cheaper 3pm-6pm (Happy Hour or "HH") after which, drinks revert to regular pricing until closing. Drinks are allowed to be purchased for staff members at an increased price. So, the cost of the drink depends on three factors:
- Time of Purchase
- Recipient of Purchase
- Type of Drink Purchased
Visually, the spreadsheet looks like this:
Excel 2010
A | B | C | D | E | F | G | |
---|---|---|---|---|---|---|---|
2 | Time | Order No | Category | Item | Unit Price | Qty | Total Unit Cost |
3 | |||||||
4 | 16:15 | 0001 | Customer Drink | SML | 75 | 1 | 75 |
5 | 16:15 | 0001 | LD | SML DLD | 250 | 1 | 250 |
6 | 20:32 | 0002 | Customer Drink | SML | 95 | 1 | 95 |
7 | 20:32 | 0002 | LD | SML DLD | 300 | 1 | 300 |
<tbody>
</tbody>
Field Explanation:
Column A - Formatted as 24hr and manually entered.
Column B - Receipt No and manually entered.
Column C - Cell drop down list (Data list on separate worksheet 'Background Data')
Column D - Cell drop down list (Data list on separate worksheet 'Background Data')
Column E - Contains the formula in question (Posted below). This formula determines the time, Category and type of drink in order to determine the Unit Price.
Column F - Manually entered.
Column G - Simple formula to calculate the Total Unit Cost.
Below is the spreadsheet with the formulas shown:
Excel 2010
A | B | C | D | E | F | G | |
---|---|---|---|---|---|---|---|
<tbody>
[TD="align: center"]2[/TD]
[TD="align: center"]Time[/TD]
[TD="align: center"]Order No[/TD]
[TD="align: center"]Category[/TD]
[TD="align: center"]Item[/TD]
[TD="align: center"]Unit Price[/TD]
[TD="align: center"]Qty[/TD]
[TD="align: center"]Total Unit Cost[/TD]
[TD="align: center"]3[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]16:15[/TD]
[TD="align: center"]0001[/TD]
[TD="align: center"]Customer Drink[/TD]
[TD="align: center"]SML[/TD]
[TD="align: center"]75[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]75[/TD]
</tbody>
Data Entry
[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<tbody>[TR="bgcolor: #DAE7F5"]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]E4[/TH]
[TD="align: left"]=IF(D4="","",IF(AND(A4>0.583333,A4<0.75,'Data Entry'!C4="Customer Drink"),VLOOKUP(D4,'Price List'!$A$3:$E$123,3,FALSE),IF(AND(A4>=0.75,A4<0.999999,C4="Customer Drink"),VLOOKUP(D4,'Price List'!$A$3:$E$123,2,FALSE),IF(AND(A4>=0,A4<0.25,C4="Customer Drink"),VLOOKUP(D4,'Price List'!$A$3:$E$123,2,FALSE),IF(AND(A4>0.583333,A4<0.75,'Data Entry'!C4="LD"),VLOOKUP(D4,'Price List'!$A$3:$E$123,5,FALSE),IF(AND(A4>=0.75,A4<0.999999,C4="LD"),VLOOKUP(D4,'Price List'!$A$3:$E$123,4,FALSE),IF(AND(A4>=0,A4<0.25,C4="LD"),VLOOKUP(D4,'Price List'!$A$3:$E$123,4,FALSE),IF(C4="Party Animal",VLOOKUP(C4,'Price List'!$A$3:$E$123,2,FALSE),IF(C4="RTB",VLOOKUP(C4,'Price List'!$A$3:$E$123,2,FALSE),IF(C4="Tossed Balls",VLOOKUP(C4,'Price List'!$A$3:$E$123,2,FALSE),IF(C4="Shirt",VLOOKUP(C4,'Price List'!$A$3:$E$123,2,FALSE),IF(C4="Beer Wrap",VLOOKUP(C4,'Price List'!$A$3:$E$123,2,FALSE),IF(C4="Towel",VLOOKUP(C4,'Price List'!$A$3:$E$123,2,FALSE),IF(C4="Key Chain",VLOOKUP(C4,'Price List'!$A$3:$E$123,2,FALSE),""))))))))))))))[/TD]
[/TR]
[TR]
[TH="bgcolor: #DAE7F5"]G4[/TH]
[TD="align: left"]=IF(E4="", "", F4*E4)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
A sample of the 'Price List' worksheet which is referenced within the VLOOKUP functions:
Excel 2010
A | B | C | D | E | |
---|---|---|---|---|---|
Other - Not Listed | |||||
Absolut Vodka | |||||
Absolut Citron | |||||
Absolut Mandarin | |||||
Absolut Raspberri | |||||
Amaretto | |||||
Antonov Ice |
<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"][/TD]
[TD="align: center"]Cust Reg[/TD]
[TD="align: center"]Cust HH[/TD]
[TD="align: center"]LD Reg[/TD]
[TD="align: center"]LD HH[/TD]
[TD="align: center"]2[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]3[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: center"]4[/TD]
[TD="align: right"] 160 [/TD]
[TD="align: right"] 135 [/TD]
[TD="align: right"] 215 [/TD]
[TD="align: right"] 195 [/TD]
[TD="align: center"]5[/TD]
[TD="align: right"] 160 [/TD]
[TD="align: right"] 135 [/TD]
[TD="align: right"] 215 [/TD]
[TD="align: right"] 195 [/TD]
[TD="align: center"]6[/TD]
[TD="align: right"] 160 [/TD]
[TD="align: right"] 135 [/TD]
[TD="align: right"] 215 [/TD]
[TD="align: right"] 195 [/TD]
[TD="align: center"]7[/TD]
[TD="align: right"] 160 [/TD]
[TD="align: right"] 135 [/TD]
[TD="align: right"] 215 [/TD]
[TD="align: right"] 195 [/TD]
[TD="align: center"]8[/TD]
[TD="align: right"] 95 [/TD]
[TD="align: right"] 75 [/TD]
[TD="align: right"] 150 [/TD]
[TD="align: right"] 135 [/TD]
[TD="align: center"]9[/TD]
[TD="align: right"] 95 [/TD]
[TD="align: right"] 75 [/TD]
[TD="align: right"] 150 [/TD]
[TD="align: right"] 135 [/TD]
</tbody>
Price List
One will notice that there are other items referenced in the formula within 'Data Entry'C4 such as "Party Animal" and "Shirt", these are items that are sold for a singular price regardless of whether they are for a customer or staff - These non dependant items are causing their own problem i.e. If "Shirt" is selected from the drop down list in cell C4 for some reason the price will not be looked up unless something from the drop down list in cell D4 is selected (which should not be required).
So, guys and gals, any suggestions on simplifying the well nested IF formula in cell E4?
Any assistance will be greatly appreciated.