Function Problems

Use Excel IF to Divide a Value Only When a Cell Says Yes

Maira MehtabMaira Mehtab Nov 18, 2026 870 views

Question details

Divide a value by a fixed number only when a trigger cell contains Yes, returning zero or a blank otherwise.

Use Excel IF to Divide a Value Only When a Cell Says Yes
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the result cell

In Excel, select I2 or another empty cell where you want the result to appear.

2
Enter the formula

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,"").

3
Apply it to other rows

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.

Use an IF formula to divide when the trigger says Yes
Check the trigger text: The comparison is not case-sensitive, so Yes and YES both match. Extra spaces can prevent a match.
Work with formulas in WPS Spreadsheets

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. 1. Open the workbook: Open WPS Spreadsheets and use Open to select your Excel workbook.
  2. 2. Select the result cell: Click I2, or choose another empty cell beside your data.
  3. 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. 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.
Apply IF formulas to conditional divisionOpen and edit Microsoft Excel XLSX and XLS filesFill formulas down a column for multiple rowsWork in a familiar spreadsheet interface
microsoft office alternative - wps office

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.