Method 1 – Showing Only When the Value Is Greater Than 0
Steps:
- Go to C5 and enter the following formula:
=IF(B5>0,B5,"")
- Press ENTER to get the output.
Formula Breakdown
- Here, B5>0 is the logical test.
- Since the statement is TRUE, Excel will return 12 as output. Otherwise, it would have shown nothing.
- Use Fill Handle to AutoFill up to C12.
Notice that for -37, Excel returned nothing.
Read More: Excel IF Statement Between Two Numbers
Method 2 – Displaying Only When the Sum Is Greater Than 0
The new dataset looks like this.
Steps:
- Select cell D5 and enter the following formula:
=IF(SUM(B5:C5)>0,SUM(B5:C5),"")
- Press ENTER to get the output.
Formula Breakdown
- SUM(B5:C5)>0 → This is the logical statement.
- Output: TRUE
- SUM(B5:C5) → This will calculate the sum of B5 and C5.
- Output: 55
- IF(SUM(B5:C5)>0,SUM(B5:C5),””) → Since the logical statement is TRUE, the output will be SUM(B5:C5)
- Output: 55
- Use Fill Handle to AutoFill up to D12.
Read More: How to Find Sum If Cell Color Is Green in Excel
Download the Practice Workbook
Download this workbook and practice.
Related Articles
- How to Use Conditional Formatting If Statement Is Another Cell
- Prepare IF Statement Contains Multiple Words in Excel
- How to Use Wildcard with If Statement in Excel
- Use IF Function with OR and AND Statement in Excel
- Use Multiple IF Statements in Excel Data Validation
- How to Check If Cell Contains One of Several Values in Excel