Microsoft KB Archive/36783

How to Use Logical Statements in a Computed Criteria PSS ID Number: Q36783 Article last modified on 02-26-1993 PSS database name: W_eXceL

2.x 3.00

WINDOWS

Summary:

This article describes how to use a logical AND or a logical OR to perform a data extract on a database according to the logical statement. An example might be where you would want to extract all the people from a database whose last name is Anderson and who live in Washington. Before starting, you should be familiar with how to set a database, set criteria, and perform a data extract (see the information beginning on Page 159 of the “Microsoft Excel Reference.”)

More Information:

It is assumed at this point that the following information has been entered on a worksheet named “SHEET1.XLS”.

  In cell A1, enter the word “Name”; in cell B1 enter the word “State”; and in cell C1 enter the word “Age” (do not enter the quotes). Enter these same names in cells E1, F1, and G1.   In cells A2 through A4, enter the names “Anderson”, “Johnson”, and “Anderson”.   In cells B2 through B4, enter the words “Washington”, “Idaho”, and “Washington”.   In cells C2 through C4, enter the values 10, 11, and 12.   Highlight the cells A1 through C4 and choose Set Database from the Data menu.   In cell D7, enter the following formula: =AND(A2=“Anderson”,B2=“Washington”)   Highlight cell D6 (which is blank) and cell D7, and choose Set Criteria from the Data menu.   Highlight cells E1 through G1, choose Extract from the Data menu, and press ENTER. The two “Anderson” records will be extracted. </li></ol>

Additional reference words: 2.10 2.1 3.0 3.00

Copyright Microsoft Corporation 1993.