Change only negative numbers to zero
This tutorial shows how to change only the negative numbers to zero using an Excel formula, with the IF function
=IF(B5<0,0,B5)
|
GENERIC FORMULA
=IF(number<0,0,number)
ARGUMENTS EXPLANATION This formula uses the IF function to check if the selected number is negative and if it is then return a value of zero (0), alternatively return the same number.
In this example the range of numbers that are being tested are from cell B5 to B9. Three of these numbers are negative and therefore the formula has returned a value of zero. For the other two numbers, that are positive, the formula has returned the same number. |
RELATED TOPICS
Related Topic | Description | Related Topic and Description |
---|---|---|
Convert negative numbers to positive | How to convert negative numbers to positive numbers | |
Convert positive numbers to negative | How to convert positive numbers to negative numbers |
RELATED FUNCTIONS
Related Functions | Description | Related Functions and Description |
---|---|---|
IF Function | The Excel IF function performs a test on specified conditions entered into the formula and returns a specified value if the result is TRUE or another specified value if the result is FALSE |