Change only positive numbers to zero

This tutorial shows how to change only the positive numbers to zero using an Excel formula, with the IF function

EXCEL FORMULA 1. Change only positive numbers to zero

EXCEL

Change only positive numbers to zero

=IF(B5>0,0,B5)
GENERIC FORMULA

=IF(number>0,0,number)

ARGUMENTS
number: A number to test if positive and if so change it to zero.

EXPLANATION

This formula uses the IF function to check if the selected number is positive 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 positive and therefore the formula has returned a value of zero. For the other two numbers, that are negative, the formula has returned the same number.

RELATED TOPICS

Related Topic Description Related Topic and Description
How to change only the negative numbers to zero
How to convert negative numbers to positive numbers
How to convert positive numbers to negative numbers

RELATED FUNCTIONS

Related Functions Description Related Functions and Description
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