AND Function in ExcelWhat is AND Function?In Excel, the AND function is a logical function that tests for a number of conditions and returns "true" or "false" based on whether the conditions are met or not. We used the AND function to see if a set of conditions in a test are TRUE. For example, the AND function can be used to test if a number in cell A2 is greater than 100 and less than 200. The AND function's purpose is to test multiple conditions. We can use the AND function as the logical test inside the IF function to avoid additional nested Ifs, and it can also be combined with the OR function. The AND function is used to verify multiple logical conditions at once, up to 255 conditions, which are supplied as arguments. Each argument (logical1, logical2, etc.) must be an expression that returns TRUE or FALSE or a value that can be evaluated as TRUE or FALSE. Constants, arrays, cell references, or logical expressions can be the arguments provided to the AND function. Syntax of the AND FunctionThe following is the syntax of the AND function:
=AND(logical1, [logical2], ...)
Arguments of the AND FunctionsThe following are the two arguments of the AND function:
The logical 1 argument is required, but the logical 2 argument is optional. Characteristics of the AND FunctionThe AND Function has the following characteristics:
The Output of AND FunctionThe following are the outputs of the AND function in various situations:
How to Use AND Function in Excel?The AND function is straightforward to use. Let's have a look at a few examples to understand how it works. Example 1:  AND FunctionIn this example, there is a game where game has four levels and 12 players. A player must complete all four levels to win. If the player fails to complete any of four levels, he or she is eliminated from the game. The player's performance at different levels is summarized in the table below. We have to decide who the winner is. Now, we apply the AND formula in column F. The formula is:
=AND(B2="yes"C2="yes",D2="yes",E2="yes")
Player D, E, I, and K have completed all the levels. The AND function returns "true" since all of the logical conditions for these four players are met. The remaining players failed to complete all four stages. The AND function returns "false" if any of the levels are not cleared. Example 1.1 AND FunctionWe'll use the AND function in this example to see if a numeric value is between two defined values. We may accomplish this by combining two logical tests with the AND function. Suppose we have the following data set: We will use the below formula:
=AND(C2>MIN(A2,B2),C2
=AND(C2>MIN(A2,B2),C2 In the above formula, the MIN function is used to compare the value to the smaller of the two numbers. In the second expression, the value is compared to the greater of the two values, which is determined by the MAX function. The AND function will return TRUE if the value is greater than the smaller number and lesser than the larger number. We get the output below: Example 1.2: AND FunctionLet's explore more about AND function with the help of this example. Suppose we want to figure out the bonus for each salesperson in our company. To be eligible for the 5% bonus, the seller must have achieved sales of more than $5,000 in one year. Otherwise, they should have met or exceeded their account objective of 5 accounts. They needed to meet both criteria in order to receive a 15% bonus. We have the below data: We'll use the AND function to determine the bonus commission. The formula will be as follows: After applying this formula, the output will be: We don't need the AND function to calculate the bonus, but we'll need to use the OR function. The following is the formula to use:
=IF(OR(B2>5000,(C2>=5)),(B2*5%),0)
After applying the formula, the result is: Example 2:  AND Function with Nested IF FunctionIn this example, we have the marks of 12 students in a school. We need to determine each student's grade based on the criteria given. A student gets "A+" if he/she scores more than 90% marks. A Grade "A" is given if the percentage is greater than or equal to 80% but less than or equal to 90%, a grade. The students fail if the percentage is less than 40%. The grades for the various percentage are also listed in the table below. We apply the below formula:
=IF(B2>90,"A+",IF(AND(B2<=90,B2>80),"A",IF(AND(B2<=80,B2>75),"B+",IF(AND(B2<=75,B2>70),"B",IF(AND(B2<=70,B2>60),"C+",IF(AND(B2<=60,B2>50),"C",IF(AND(B2<=50,B2>40),"D","FAIL")))))))
If we use the nested IF function with numerous AND functions to calculate the grades. The later enables the simultaneous testing of two conditions. The following is the syntax for the IF function:
=IF(logical_test,[value_if_true],[valueiffalse])"
The IF function return "true" if the condition is met, otherwise "false." "B2>90" is the initial logical test or condition. The grade "A+" is assigned if this condition is "true". If the condition is "false" then the IF function evaluates the next condition. "B2<=90, B2>80 is the next logical test or condition. If this condition is "true," grade "A" is allotted. If this condition is "false" then the next statement is evaluated. Similarly, the IF function checks each condition in the formula. "B2=50, B2>40" is the final logical test. If this condition is "true" the student is assigned a grade "D", but if it is not, the student will fail. As illustrated in the below image, we use the formula for all categories of students. Example 3: Nested AND FunctionIn this example, we will understand the concept of nested AND function. In this example, we have a list of people who want to join the army if certain requirements are met. The following are the eligibility requirements:
We have to determine which prospects are eligible to join the Army. We utilize the nested AND function in order to evaluate the candidates based on the specified parameters. The following formula is used.
=AND(B2>167,C2="Normal",D2="Successful",AND(E2>=18,E2<35))
We evaluate multiple logical conditions at the same time. We also look to see if the age is within the prescribed range. As a result, we use the AND function within another AND function. The formula's result is depicted in the following figure. Anurag and Trishant are the only candidates who meet the selection requirements or conditions. As a result, the output of their eligibility (column F) is "true." The rest of the candidates are ineligible to join the army. Limitations of AND FunctionThe following are the limitations of AND function:
The following two images demonstrate the results of the AND function if an empty cell and a text string are provided as an argument.
Next TopicHow to do subtraction in Excel
