The Excel AND function is one of the logical functions. Learn how to determine if all conditions in a test are TRUE.

## Using Excel AND Function

**Here is how the AND function works:** The AND function tests multiple conditions with AND and returns TRUE if all arguments evaluate TRUE; FALSE if not. The function is ideal for simplifying complex conditions in Excel. Instead of writing multiple IF statements or nested formulas, you can use AND to handle multiple logical tests in a single, straightforward formula. This makes your formulas easier to read.

AND has two outputs: **TRUE** or **FALSE.**

For example, to test if a number in cell C5 is greater than 150 and less than 180, use the formula below:

=AND(C5>150, C5<180)

If both conditions are TRUE, the result is TRUE.

Using the IF logical function with multiple logical tests is a great idea. You can also use the AND logical function instead of a nested IF function.

Suppose you want to evaluate whether a cell value falls within a specific range. For instance, if you’re checking if a value in cell C5 is greater than 150 and less than 180, you could use:

=AND(C5>150,C5<180) is equivalent to =IF(AND(C5>150,C5<180,TRUE,FALSE))

This formula returns TRUE only when both conditions are met, indicating that the value in C5 falls within the specified range. When combined with IF, the AND function enables further calculations based on multiple conditions. For example:

=IF(AND(C5 > 150, C5 < 180), “Within Range”, “Out of Range”)

If both conditions are true, the result will display “Within Range”; otherwise, it will show “Out of Range.”

### Syntax and Arguments

**Syntax:**

=AND(logical test1, logical 2 test,…..)

**Arguments:**

- logical test1: the function evaluates the first condition
- logical test2: [optional argument], the second condition

## AND Function Examples

In this example, you’re testing if a cell value meets two conditions simultaneously. You will check if the value in C7 is greater than 100 and less than 160. If both conditions are true, the formula returns TRUE; if even one condition is false, it returns FALSE.

=AND(C7>100, C7<160)

In this case, the result is FALSE. Take a closer look at the formula:

- =
**C7 > 100**return**TRUE** - =
**C7 < 160**return**FALSE**

Because AND requires all conditions to be true to output TRUE, the formula results in FALSE for 191. This demonstrates how AND enforces strict criteria, making it perfect for situations where you need multiple conditions to be met at once before proceeding.

## Combine AND and IF function

In the next example, you can place the AND function inside an IF function.

**Formula:**

=IF(AND(C3>100, C3<500), “Yes”, “No”)

This formula checks if the value in C3 is greater than 100 and less than 500. If both conditions are true, it returns “Yes”; otherwise, it returns “No.” This approach is useful for categorizing or validating data within specified ranges, giving you a clear, customized response based on the conditions set.

For example, if C3 contains 200, the formula will return “Yes” because it meets both criteria. However, if C3 holds a value outside this range, it will output “No.”

## Combine AND and OR function

Combining AND and OR functions in Excel allows you to create flexible logical tests that cover multiple scenarios. Here’s a formula example:

=AND(C3=200,OR(D3=”Product 1″,D3=”Product 2″))

The formula returns TRUE when C3 = 200 and D3 is “Product 1” or “Product 2”.

If both these criteria are TRUE, the AND formula returns TRUE; otherwise, it returns FALSE. In the example, the only row with values that met the criteria is 4.

## AND function returns #VALUE error

The AND function returns a #VALUE! error if the arguments are not logical values or do not evaluate to logical conditions (TRUE or FALSE). For instance, if you use:

=AND(C4, D4)

where cells C4 and D4 contain non-logical values (like text), Excel cannot perform a logical test, resulting in the #VALUE! error.

To avoid this error, you can use error handling. Ensure that all arguments within the AND function are either logical values or expressions that can be evaluated as TRUE or FALSE. If non-logical data types are expected, consider using functions like ISNUMBER or ISTEXT within AND to handle different data types effectively and prevent errors.

### Wrapping things up

**The AND function:**

- has two outputs: TRUE or FALSE
- not case-sensitive
- can handle up to 255 arguments
- does not support wildcards
- text values or empty cells are ignored
- return the #VALUE error if no logical values are found or created during the evaluation

**Additional resources:**