How to use IF Function with Negative Numbers in Excel?

The IF Function can be used with Negative Numbers in Excel by using the IF function to compare two values, and outputting a result depending on whether the first value is greater than, less than, or equal to the second value. The IF function allows the user to provide a value if the comparison is true, or another value if the comparison is false. This is especially useful when dealing with negative numbers, as the user can specify the output depending on whether the numbers are negative or positive.


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<0, "Yes", "No")

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<0, "Yes", "No")

We can then click and drag this formula down to each remaining cell in column C:

Excel IF function with negative numbers

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

=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.

x