What is Nested Applications of the IF Function?
In the IF function:
IF(A,B,C)can be understood as: if condition A is met, return B; otherwise, return C.
When the IF function is nested,
IF(A,B,IF(C,D,E))can be understood as: If condition A is met, return B. If condition A is not met but condition C is met, return D. If neither A nor C is met, return E.
This article introduces the nested use of the IF function through the following two examples, helping enterprises handle various conditional judgment scenarios.
Determining grades based on scores
Calculating discounted prices
Determining Grades Based on Scores
In score grading scenarios: Scores from 90 to 100 are rated as Excellent. Scores from 75 to 89 are rated as Good. Scores from 60 to 74 are rated as Pass. Scores below 60 are rated as Fail.
Create a form based on the above grading rules. The detailed steps are as follows:
Step 1 Building the Form
Create a form named Determining Grades Based on Scores and configure the fields as follows:
Field Name | Field Type |
Score | Number |
Grade | Single Line |
Step 2 Setting the Formula
1. Select the Grade field. In Field Properties > Initial Value, select Formula and click Edit below.
2. In the Formula Editor, set the formula for the Grade field as follows:
IF(Score>=90,"Excellent",IF(Score>=75,"Good",IF(Score>=60,"Pass","Fail")))
This formula means: When the score is greater than or equal to 90, return Excellent.
When the score is less than 90 but greater than or equal to 75, return Good. When the score is less than 75 but greater than or equal to 60, return Pass. When the score is less than 60, return Fail.
Step 3 Demonstration
Calculating Discounted Prices
Follow these steps to set up a form that applies the discount rules: no discount for amounts under 1,000, 10% off for 1,000–2,000, 20% off for 2,000–3,000, and 30% off for 3,000 and above.
Step 1 Building the Form
Create a form named Calculating Discounted Price and configure the fields as follows:
Field Name | Field Type |
Original Price | Number |
Discount Rate | Number |
Discounted Price | Number |
Step 2 Setting the Formula
1. Select the Discount Rate field. In Field Properties > Initial Value, select Formula Editor as the default value type, and click Edit Formula below.
2. In the Formula Editor, set the formula for the Discount Rate field as follows:
IF(Original Price<1000,10,IF(Original Price<2000,9,IF(Original Price<3000,8,7)))
This formula means: When the original price is less than 1,000, the discount rate is 10. When the original price is greater than or equal to 1,000 and less than 2,000, the discount rate is 9. When the original price is greater than or equal to 2,000 and less than 3,000, the discount rate is 8. When the original price is greater than or equal to 3,000, the discount rate is 7.
3. Use the same method to set the formula for the Discounted Price field:
Original Price*Discount Rate/10
This means the discounted price equals the original price multiplied by the discount rate and divided by 10.
Step 3 Demonstration








