Contextures

Excel -- Create an Order Form

In this order form, Data Validation is used to create a dropdown list of available products. In adjacent cells, VLookup formulas return the price of the selected products.



Set up the Workbook

Two worksheets are required in this workbook.

  1. Delete all sheets except Sheet1 and Sheet2
  2. Rename Sheet1 as Order Form
  3. Rename Sheet2 as Products

Create the Product List

  1. On the Products sheet, type the list of products and prices, as shown below
  2. .

  3. Select the list of products in cells A2:A6
  4. Name the range ProductList (there are Naming instructions here: Name a Range)
  5. Select the list of products and prices in cells A2:B6
  6. Name the range ProductLookup. 

Create a Data Validation Dropdown List

The next step is to create the data validation dropdown lists, to make it easy to enter a product in the order form. There are detailed instructions here: Data Validation -- Introduction 

  1. On the Order Form worksheet, select cells B5:B12
  2. Choose Data | Validation
  3. From the Allow dropdown, choose List
  4. In the Source box, type:   =ProductList
  5. Click the OK button  

Add the VLookup Formula

VLookup formulas in column C will return the price for each product selected in the order form. The VLookup formula is wrapped with an IF formula, to prevent errors if no product has been selected in a row. For more information on the VLookup formula, see Worksheet Functions -- VLookup

  1. On the Order Form worksheet, select cells C5:C12
  2. Type the formula:
      =IF(B5="","",VLOOKUP(B5,ProductLookup,2,FALSE))
  3. Press Ctrl + Enter, to enter the formula in all the selected cells.

Calculate the Row Total

Quantity will be entered in column D, and the row total calculated in column E. The formula is wrapped with an IF formula, to prevent a zero calculation if no product has been selected in a row.

  1. On the Order Form worksheet, select cells E5:E12
  2. Type the formula:      =IF(C5="","",C5*D5)
  3. Press Ctrl + Enter, to enter the formula in all the selected cells.

Total the Order

The SUM function is used to total all the rows in the Order Form.

  1. On the Order Form worksheet, select cell E14
  2. Type the formula:      =SUM(E5:E12)
  3. Press Enter, to complete the formula.

Format the Order Form

Add cell borders and font formatting, to make the Order Form more attractive, and easy to use.

  1. On the Order Form worksheet, add column headings in row 4, as shown at right.
  2. Add the main heading, "Order Form", in cell B2
  3. In cell C14, type "Total"
  4. In cell E2, type the formula:       =TODAY()
  5. Select cells B4:E12, and add borders.
  6. Add fill colour to columns B and D, where data entry is required.
  7. Format the heading fonts as bold
  8. Format the date as desired.

Add a Customer List

To enhance the order form, you can add a worksheet with customer names and addresses. Then, select a customer name on the order form, and have their address fill in automatically.

Add the Customer List

  1. Insert a new worksheet, and name it Customers
  2. On the Customers sheet, in row 1, and the headings, Name, Street, City, Prov, PostalCode, DateEntered.
  3. In the following rows, enter data for a few sample customers.
  4. To name the customer list (for the dropdown list), select cell A2
  5. Choose Insert | Name | Define
  6. Type the name: CustList
  7. In the Refers to box, type:
    =OFFSET(Customers!$A$2,0,0,COUNTA(Customers!$A:$A)-1,1)
  8. Click Add
  9. To name the Customer lookup table (for the address lookup), type the name: CustLookup
  10. In the Refers to box, type:
    =OFFSET(CustList,,,,6)
  11. Click OK

Create the Customer Dropdown and Lookup

  1. On the Order Form worksheet, select rows 3:7
  2. Choose Insert | Rows
  3. In cell B4, type: Ship to:
  4. In cell B5, add a Data Validation list, with CustList as the source
  5. Select cells B6:E6, and choose Format | Cells
  6. On the Alignment tab, add a check mark to the Merge Cells box, click OK
  7. Select cells B7:E7, and press the F4 key, to repeat the previous formatting
  8. In cell B6, type the formula:
    =IF(B5="","",VLOOKUP(B5,CustLookup,2,FALSE))
  9. In cell B7, type the formula that will lookup city, province, and postal code:
    =IF(B5="","",VLOOKUP(B5,CustLookup,3,FALSE)&", " &VLOOKUP(B5,CustLookup,4,FALSE)&" " &VLOOKUP(B5,CustLookup,5,FALSE))
  10. To test the formulas, select a customer from the dropdown list in cell B5, and the address should appear in B6 and B7.

Download the Sample File

Download the zipped sample file


Custom Search

 

30 Excel Functions in 30 Days

 

 

 

 

 

 

 

 


Last updated: April 24, 2015 4:14 PM