You can use the following formulas to use an IF function with negative numbers in Excel:
Method 1: Use IF Function to Check if Cell Contains Negative Number
=IF(B2
This formula will return “Yes” if the value in cell B2 is negative (i.e. less than zero) – otherwise it will return “No.”
Method 2: Use IF Function to Check if Cell is Negative, Zero or Positive
=IF(B2=0,"Zero",IF(B2>0,"Positive", "Negative"))
This formula will return the following values:
- “Zero” if cell B2 is equal to zero.
- “Positive” if cell B2 is a positive value.
- “Negative” if cell B2 is a negative value.
The following examples show how to use each formula in practice with the following dataset in Excel:
Example 1: Use IF Function to Check if Cell Contains Negative Number
We can type the following formula into cell C2 to return “Yes” if the value in cell B2 is negative or return “No” otherwise:
=IF(B2
We can then click and drag this formula down to each remaining cell in column C:
The formula returns “Yes” for each row where the value in the Net Sales column is negative and “No” for each row where the value is positive.
Example 2: Use IF Function to Check if Cell is Negative, Zero or Positive
We can type the following formula into cell C2 to return “Zero”, “Negative” or “Positive” depending on the value in cell A2:
=IF(B2=0,"Zero",IF(B2>0,"Positive", "Negative"))
We can then click and drag this formula down to each remaining cell in column C:
The formula returns “Zero”, “Negative” or “Positive” depending on the corresponding value in column A.
Additional Resources
The following tutorials explain how to perform other common tasks in Excel:
Excel: How to Use IF Function with Multiple Conditions
Excel: How to Create IF Function to Return Yes or No
Excel: How to Use an IF Function with Range of Values