How to Use Excel IF Formula to Add Columns When Value is Greater Than Zero
Question details
The user needs an Excel formula to check if a value in one column is greater than zero, and if true, add the corresponding values from two other columns in the same row.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Conditionally summing data across multiple columns based on a positive value check in a reference column.
- Observed behavior
- The goal is to return the sum of Columns A and B when Column C is positive, and output a specific message when it is not.
Ensure your dataset is organized in clear columns (e.g., Columns A, B, and C) and that the cells you intend to add contain valid numbers rather than text formatted to look like numbers.
Use a Standard IF Formula with Addition
Apply a basic IF statement to test the condition and conditionally add the two cells together.
The IF function in Excel evaluates a logical test and returns one value if true, and another if false. By combining this with simple cell addition, you can achieve your goal efficiently.
Click on the cell where you want the result to appear, for example, D3.
Type the formula `=IF(C3>0, A3+B3, "Column C is not greater than zero")` into the formula bar and press Enter.
Click on cell D3 again, hover over the small square at the bottom-right corner of the cell (the fill handle), and drag it down to copy the formula to the rest of your data rows.

Use the SUM Function Inside the IF Formula
If you have a larger range of columns to add together, embedding the SUM function inside the IF statement is cleaner and more scalable.
Easily Manage Conditional Formulas with WPS Spreadsheet
WPS Office provides a highly compatible and intuitive spreadsheet application where you can effortlessly use IF, SUM, and other advanced logical functions just like in Microsoft Excel.
- 1. Open your file in WPS Spreadsheet: Launch WPS Office and open your existing spreadsheet data.
- 2. Select the result cell: Click on the cell in the row where you want to display the conditional sum.
- 3. Input the formula: Type `=IF(C3>0, A3+B3, "")` and press Enter to instantly calculate the result.
- 4. Autofill the column: Drag the fill handle downwards to apply this conditional logic to all rows in your dataset.

Frequently Asked Questions
Can I use this formula if my numbers contain decimals?
Yes, the IF function and basic addition formulas work perfectly with both whole numbers and decimals. The spreadsheet will automatically calculate the exact numerical sum.
What if I want the cell to remain blank when the value is not greater than zero?
You can replace the text string at the end of the formula with double quotation marks. The modified formula would look like `=IF(C3>0, A3+B3, "")`.
How do I add more than two columns if the condition is met?
Instead of chaining multiple plus signs (e.g., A3+B3+C3), you can nest the SUM function inside the IF statement, formatted as `=IF(D3>0, SUM(A3:C3), 0)`.
Why am I getting a #VALUE! error when using this formula?
This error typically occurs if one of the cells you are trying to add (such as A3 or B3) contains text or a space character instead of a valid number. Ensure all cells in your calculation range are formatted properly as numbers.




