How to Ignore a Zero Cell in an Excel Calculation
Question details
The user needs a formula to conditionally calculate the product of three cells, modifying the calculation to multiply only two cells if the third cell contains a zero.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating dimensions such as volume or surface area where one parameter might be zero, which would normally result in a total calculation of zero.
- Observed behavior
- Standard multiplication returns zero if any cell is zero. The desired behavior is to multiply B1 and C1 when D1 is 0, and multiply B1, C1, and D1 when D1 contains a nonzero value.
Identify the specific cells involved in your calculation and ensure your data is formatted as numbers. Verify which cell will serve as the conditional trigger (e.g., the cell that might contain the zero value).
Use the IF Function to Conditionally Ignore the Zero Cell
The IF function allows you to test whether a cell equals zero and execute a different mathematical operation based on the result.
The IF function evaluates a logical condition and returns one value if the condition is true, and another if it is false. By checking if the target cell is zero, you can prevent the entire multiplication formula from returning zero and instead default to calculating the product of the remaining cells.
Click on the empty cell where you want the final calculated value to appear.
Type the formula =IF(D1=0,B1*C1,B1*C1*D1) into the formula bar at the top of the screen.
Press the Enter key. If D1 contains a 0, the cell will display the product of B1 and C1. If D1 contains a nonzero number, it will display the product of all three cells.

Handle Conditional Calculations Easily with WPS Spreadsheet
WPS Spreadsheet provides powerful formula support, including logical functions like IF, allowing you to seamlessly handle zero values and conditional data processing. It is designed for maximum efficiency and full compatibility with existing spreadsheet files.
- 1. Open your file in WPS Office: Launch WPS Office and open your workbook containing the data you need to calculate.
- 2. Enter the conditional formula: Select the cell for your result and input =IF(D1=0,B1*C1,B1*C1*D1).
- 3. Apply and fill: Press Enter to calculate the result. Click and drag the fill handle at the bottom-right corner of the cell to apply this conditional logic to the remaining rows.

Frequently Asked Questions
How do I ignore zero values when calculating an average?
To exclude zero values from an average calculation, use the AVERAGEIF function. For example, enter the formula =AVERAGEIF(A1:A10, "<>0") to calculate the average of only the nonzero numbers in that range.
Can I hide zero values completely in my spreadsheet?
Yes, you can hide all zeros on a worksheet. Go to File > Options > Advanced, scroll down to the 'Display options for this worksheet' section, and uncheck the box that says 'Show a zero in cells that have zero value'.
What if the cell is completely blank instead of containing a zero?
A blank cell is often treated as a zero in multiplication formulas. To specifically handle blank cells, you can use the ISBLANK function nested within your IF statement, such as =IF(ISBLANK(D1),B1*C1,B1*C1*D1).




