How to Use Excel IF and AND Formula for Values Between 5 and 50
Question details
The user needs to calculate 9% of a cell's value only if that value is strictly greater than 5 and strictly less than 50 using Excel functions.
- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating a specific percentage for numbers that fall within a defined numerical range while accounting for regional formatting differences.
- Observed behavior
- The user requires the correct syntax to apply the IF and AND functions together, handling the distinction between commas and semicolons based on regional settings.
Check your computer's regional settings to determine whether your version of Excel uses commas or semicolons to separate formula arguments.
Use Comma Separators for Standard US Regional Settings
Apply this formula if your system uses decimal points and comma separators for arguments.
In standard US and UK regional settings, Excel uses a comma (,) to separate arguments in a formula and a period (.) for decimal values. The AND function checks if the value meets both conditions, and the IF function applies the 9% calculation if true.
Click on the cell where you want the calculated result to appear.
Type =IF(AND(A2>5,A2<50),A2*0.09,"") into the formula bar, assuming your source value is in cell A2.
Press Enter to apply the formula. If the value is outside the 5 to 50 range, the cell will remain blank.
Use Semicolon Separators for European Regional Settings
Use this syntax if your computer settings use decimal commas and semicolon separators.
Calculate Complex Formulas Easily with WPS Spreadsheet
WPS Spreadsheet fully supports standard Excel formulas, including nested IF and AND functions. You can seamlessly calculate ranges, manage data, and format results with high precision while avoiding regional syntax errors.
- 1. Open WPS Spreadsheet: Launch WPS Office and open your data workbook.
- 2. Select the Target Cell: Click the cell where you want to output the calculation.
- 3. Enter the Formula: Type the IF and AND formula and press Enter to instantly see the result.

Frequently Asked Questions
Why does my IF and AND formula return a syntax error?
This usually happens due to incorrect regional separators. Check if your system requires semicolons (;) instead of commas (,) between formula arguments.
How can I return a zero instead of a blank cell if the condition isn't met?
Replace the empty quotes ("") at the end of the formula with a zero. For example, using US settings: =IF(AND(A2>5,A2<50),A2*0.09,0).
Can I use this formula to include the numbers 5 and 50 in the calculation?
Yes, to include 5 and 50 exactly, change the greater than and less than operators to greater than or equal to (>=) and less than or equal to (<=). The formula becomes =IF(AND(A2>=5,A2<=50),A2*0.09,"").




