Use Excel IF to Divide a Value Only When a Cell Says Yes
Question details
Divide a value by a fixed number only when a trigger cell contains Yes, returning zero or a blank otherwise.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet uses a response in C2 to determine whether the value in H2 should be divided by 50.
- Observed behavior
- The desired result is H2 divided by 50 when C2 says Yes, and zero or a blank for other responses.
Identify the trigger cell, the cell containing the numeric value, and an empty cell for the result. The examples below use C2, H2, and I2 respectively, with 50 as the divisor.
Use an IF formula to divide when the trigger says Yes
Use this formula to return the divided value for Yes and zero or a blank for any other response.
In Excel, select I2 or another empty cell where you want the result to appear.
Type =IF(C2="Yes",H2/50,0) in I2 and press Enter. To return a blank instead of zero, use =IF(C2="Yes",H2/50,"").
Select I2 and drag its fill handle down the column to apply the formula to subsequent rows. Adjust the cell references or divisor if your worksheet uses different cells or a different fixed number.

Divide values conditionally in WPS Spreadsheets
Use the same IF formula in WPS Spreadsheets to divide a value only when a trigger cell says Yes.
- 1. Open the workbook: Open WPS Spreadsheets and use Open to select your Excel workbook.
- 2. Select the result cell: Click I2, or choose another empty cell beside your data.
- 3. Enter the IF formula: Type =IF(C2="Yes",H2/50,0) and press Enter. Replace 0 with "" if you prefer a blank for other responses.
- 4. Fill down and save: Drag the fill handle down to apply the formula to other rows, then use File > Save to save your changes.

Frequently Asked Questions
How do I return a blank instead of zero?
Enter =IF(C2="Yes",H2/50,"") in the result cell. The empty string displays as a blank when C2 does not match Yes.
Will the formula work if the cell says YES in uppercase?
Yes. The comparison C2="Yes" is not case-sensitive, so YES and yes also match.
Why does the formula return zero when the cell appears to say Yes?
Check C2 for extra spaces. You can remove leading and trailing spaces in the comparison with =IF(TRIM(C2)="Yes",H2/50,0).
How do I use a different divisor or apply the formula to more rows?
Replace 50 in the formula with your fixed divisor. Then select the result cell and drag its fill handle down to apply the formula to other rows.




