0% found this document useful (0 votes)
12 views

How To Used Excel Functions

The document discusses using logical functions like AND, OR, XOR, and IF in Excel formulas to evaluate multiple conditions and return true or false, text, or numeric values. Examples are provided to check sales data against date ranges, evaluate cells for text or numeric criteria, compare column values, and combine IF with AND to check multiple conditions.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

How To Used Excel Functions

The document discusses using logical functions like AND, OR, XOR, and IF in Excel formulas to evaluate multiple conditions and return true or false, text, or numeric values. Examples are provided to check sales data against date ranges, evaluate cells for text or numeric criteria, compare column values, and combine IF with AND to check multiple conditions.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

FIGURE 2–1

NOTE If both criteria are valid, Excel shows the value as TRUE; otherwise, it is FALSE.

USE THE AND FUNCTION TO SHOW SALES FOR A SPECIFIC


PERIOD OF TIME
This example checks all rows for a specific time period using the AND function. The
function returns TRUE if all the arguments are TRUE and FALSE if one or more arguments
are FALSE.

NOTE Up to 30 conditions can be used in one formula.

To show sales in a period of time:

1. Select cell B1 and enter the start date.


2. Select cell B2 and enter the end date.
3. The range A5:A16 contains dates ranging from 09/11/04 to 09/22/04.
4. The range B5:B16 contains sales amounts.
5. Select cells C5:C16 and type the following formula:
=AND(A5>B$1,A5<=$B$2).
6. Press <Ctrl+Enter>.
FIGURE 2–2

USE THE OR FUNCTION TO CHECK CELLS FOR TEXT


A worksheet contains several words in column A. Each row has to be checked for the
words “new” or “actual” in column A. The OR function is used for this task. The function
returns TRUE if either argument is true and FALSE if both arguments are not true.

NOTE Up to 30 conditions can be used in one formula.

To use the OR function to check for two or more criteria:

1. Enter in range A2:A10 words like “new," “actual," and “old."


2. Select cells B2:B10 and type the following formula:
=OR(A2="New",A2="actual").
3. Press <Ctrl+Enter>.
FIGURE 2–3

USE THE OR FUNCTION TO CHECK CELLS FOR NUMBERS


A worksheet contains several values in column A. Each row has to be evaluated based on
certain the specific value in column A. The OR function is used for this task. The function
returns TRUE if any argument is TRUE and FALSE if all arguments are FALSE.

NOTE Up to 30 conditions can be used in one formula.

To check for two or more criteria:

1. Enter in range A2:A12 values from –43 to 100.


2. Select cells B2:B12 and type the following formula:
=OR(A2=1,A2>=99,A2<0).
3. Press <Ctrl+Enter>.
FIGURE 2–4

USE THE XOR FUNCTION TO CHECK FOR MUTUALLY


EXCLUSIVE CONDITIONS
A worksheet contains several values in column A and another set of values in column B.
The columns must contain in the same row one number above 900 but not both. The XOR
function is used for this task. The function returns TRUE if only one argument is TRUE,
FALSE if both arguments are TRUE, and FALSE if all arguments are FALSE.

To check for the specified criteria:

1. Enter in range A2:A12 values from 0 to 1,000.


2. Enter in range B2:B12 values from 0 to 1,000.
3. Select cells C2:C12 and type the following formula:
=XOR(A2>=900,B2>=900).
4. Press <Ctrl+Enter>.
FIGURE 2–5

USE THE IF FUNCTION TO COMPARE COLUMNS AND


RETURN A SPECIFIC RESULT
As shown in earlier examples, Excel returns the value TRUE or FALSE when using the OR
and AND functions. The IF function can also be used to conduct conditional tests on values
and formulas.
This example compares two columns and shows the result in column C.

To return specific text after comparing values:

1. Enter in range A2:A12 values from 0 to 1,000.


2. Enter in range B2:B12 values from 0 to 1,000.
3. Select cells C2:C12 and type the following formula:
=IF(A2>=B2,"Column A is greater or equal","Column B is greater").
4. Press <Ctrl+Enter>.
FIGURE 2–6

USE THE IF FUNCTION TO CHECK FOR LARGER,


EQUIVALENT, OR SMALLER VALUES
In the previous example, two different messages were used as the result for comparing
values. To check for three conditions in column A and present the result as “Column A is
larger,” “equal,” or “Column A is smaller,” perform the following steps.

To compare columns and show the result:

1. Copy the previous example.


2. Select cells C2:C12 and type the following formula:
=IF(A2>B2,"Column A is larger",IF(A2=B2,"Equal", “Column A is smaller")).
3. Press <Ctrl+Enter>.
FIGURE 2–7

NOTE Up to seven IF functions can be combined in one cell. To combine more than seven
functions, use the customized solution near the end of this chapter.

COMBINE IF WITH AND TO CHECK SEVERAL CONDITIONS


In this example, Excel evaluates which condition meets the criteria and returns the result in
the same row.

To combine the IF and AND functions:

1. Copy the content of cells C2:C5 in Figure 2–8 to your Excel table.
2. Frame the table as shown in the screenshot.
3. Select cell A2 and enter any kind of sales value, e.g., 120.
4. In cell B2, type the following formula:
=IF(AND($A$2<=100,$A$2),"Sales value is","").
5. In cell B3, type the following formula:
=IF(AND ($A$2>100,$A$2<=150),"Sales value is","").
6. In cell B4, type the following formula:
=IF(AND ($A$2>150,$A$2<=200),"Sales value is","").
7. In cell B5, type the following formula:
=IF($A$2>200,"Sales value is","").

You might also like