Use an Excel IF Formula to Set Priority 9 for Condition A
Question details
The user needs a formula that returns priority 9 when a condition is A and displays a blank result otherwise.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Assign a priority based on a condition in a worksheet cell.
- Observed behavior
- The desired result is 9 for condition A and a blank result for other conditions.
Identify the cell containing the condition and choose an empty cell for the formula. The examples below assume the condition is in A2 and, when checking an existing priority, the priority is in B2.
Return priority 9 when the condition is A
Use this formula when you want Excel to calculate the priority automatically.
Select an empty result cell, such as B2, and enter =IF(A2="A",9,""). Press Enter.
Drag the fill handle from the result cell down the column. Replace A2 in the formula if your condition is stored in a different cell.

Check an existing priority for condition A
Use this formula when a priority has already been entered and you want to flag values other than 9.
Set priority 9 with an IF formula in WPS Spreadsheets
Use WPS Spreadsheets to enter the same IF formula, fill it down your worksheet, and save the result in an Excel-compatible format.
- 1. Open your worksheet: Open WPS Spreadsheets and select Open to load your workbook.
- 2. Enter the formula: Select an empty result cell and enter =IF(A2="A",9,""). Replace A2 with the cell containing your condition, then press Enter.
- 3. Fill down and save: Drag the result cell's fill handle down the column, then choose File > Save or Save As to save the workbook.

Frequently Asked Questions
How do I change the condition cell in the formula?
Replace A2 in =IF(A2="A",9,"") with the cell that contains your condition. For example, use C2 if the condition is in column C.
Does the formula distinguish between uppercase and lowercase A?
No. The comparison A2="A" is not case-sensitive, so it also matches a lowercase a.
How can I check a priority someone has already entered?
If the condition is in A2 and the priority is in B2, enter =IF(A2="A",IF(B2=9,"OK","Priority must be 9"),"") in another cell.
Why does the result look blank for other conditions?
The final "" in the IF formula returns an empty text string when the condition is not A. The cell contains a formula even though it appears blank.




