Formula Errors

Return a Value from Another Column with an IF Formula in WPS Spreadsheets

Anum MushtaqAnum Mushtaq Dec 2, 2026 869 views

Question details

Return the value from column I when column EK is zero; otherwise, calculate the result without dividing by zero.

Return a Value from Another Column When a Condition Is Met
Product
WPS Spreadsheets and Microsoft Excel
Device & OS
not provided
Scenario
A worksheet needs a conditional formula in column N that either returns a value from column I or calculates J divided by BX and multiplied by CA.
Observed behavior
Column N should return I when EK is zero, return zero when BX is zero, and otherwise calculate J/BX*CA.
Before you start

Confirm that your data starts on row 8 and that columns I, J, BX, CA, and EK contain the values used by the formula. Adjust the row numbers if your first data row is different.

Solution 1Recommended

Use a Nested IF Formula in Column N

Check EK first, then guard against a zero denominator before calculating the existing result.

1
Select the result cell

Open the worksheet and select cell N8.

2
Enter the formula

In the formula bar, enter =IF($EK8=0,$I8,IF($BX8=0,0,$J8/$BX8*$CA8)) and press Enter.

3
Fill down

Drag the fill handle from the lower-right corner of N8 down column N to apply the formula to the remaining rows.

4
Check the results

Test a row where EK is zero, one where EK is nonzero and BX is zero, and one where both are nonzero. The results should be I, zero, and J/BX*CA, respectively.

Use a Nested IF Formula in Column N
Column and row references: The dollar signs lock the column references, while the row numbers change as you fill the formula down. The formula prevents division by zero but does not handle every possible error, such as nonnumeric input.
Calculate with WPS Spreadsheets

Build the Conditional Formula in WPS Spreadsheets

Use WPS Spreadsheets to enter the nested IF formula, check the result, and fill it down for other rows.

  1. 1. Open the worksheet: Launch WPS Spreadsheets and use Open to select your workbook.
  2. 2. Select N8: Click cell N8, or select the first result cell if your data starts on another row.
  3. 3. Enter the formula: Type =IF($EK8=0,$I8,IF($BX8=0,0,$J8/$BX8*$CA8)) in the formula bar and press Enter.
  4. 4. Apply it to other rows: Drag N8's fill handle down column N, then check a few results against their source values.
Return a value from column I when the condition in EK is metAvoid division-by-zero errors when BX is zeroOpen and edit Microsoft Excel XLSX and XLS filesFill formulas down across multiple rows
QA img-9

Frequently Asked Questions

What happens if both EK and BX are zero?

The formula checks EK first, so it returns the value from I and does not evaluate the division.

Can I return something other than zero when BX is zero?

Yes. Replace the 0 in IF($BX8=0,0,$J8/$BX8*$CA8) with another value, such as "Not available".

Why do the cell references have dollar signs?

In references such as $EK8, the dollar sign locks the column but leaves the row relative. When you fill the formula down, $EK8 changes to $EK9, $EK10, and so on.

Will this formula work in Microsoft Excel?

Yes. Excel supports the same nested IF formula. Enter it in N8 and fill it down as needed.