Query By Example

The Query By Example command extracts rows for worksheets based on the criteria you specify.

In the Columns To Query section, check the column that you would like to test. Use the right hand side of the dialog to specify the values that you would like to test for. Options on the right hand side of the dialog will vary according to the type of column (text, date or number) that is selected.

You can select multiple columns and perform multiple tests on each column. If you are querying on multiple columns you can specify that all (The All selected columns must meet at least one condition is checked) or any (The All selected columns must meet at least one condition is not checked) of the column conditions must be true in order for a row to be extracted.

You can reverse the condition simply by checking the NOT option.

The Range button can be used to select examples from an existing worksheet. You can specify multiple examples by separating them with commas.

Example

  • Open Easy-XL's Sample Workbook
  • Select the Invoices Sheet
  • Select Query By Example from the Easy-XL Menu
  • In the Query By Example dialog box, select SalesPerson in the Columns to Query section. In the Select Rows Where section, choose column equals and then click the Range box.
  • At this point the Select Range dialog box appears. You can enter a range, or for this example, click on the SalesPeople sheet and then select a range of values in the SalesPerson column.
  • Select Finished.