You can use the following formula to use an **IF** function to return “net income” or “net loss” based on the value of specific cells in Excel:

=IF(B2>C2,"Net Income",IF(B2<C2,"Net Loss", "Even"))

Assuming total revenue is in cell **B2** and total expenses is in cell **C2**, this IF function returns the following values:

- If revenue is greater than expenses, then return “Net Income”
- If revenue is less than expenses, then return “Net Loss”
- Otherwise, if revenue is equal to expenses, then return “Even”

The following example shows how to use this formula in practice.

**Example: Use IF Function to Return Net Income or Net Loss in Excel**

Suppose we have the following dataset in Excel that shows the total revenue and expenses of various retail stores in different locations:

Suppose we would like to create a formula to return either “Net Income”, “Net Loss”, or “Even” to indicate how the revenue compared to the expenses in each region.

We can type the following formula into cell **D2** to do so:

=IF(B2>C2,"Net Income",IF(B2<C2,"Net Loss", "Even"))

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

Column D now displays “Net Income”, “Net Loss” or “Even” to indicate how the revenue compared to the expenses in each region.

For example:

- Revenue was less than expenses in the
**North**region, so the formula returned “Net Loss” - Revenue was greater than expenses in the
**East**region, so the formula returned “Net Income” - Revenue was greater than expenses in the
**South**region, so the formula returned “Net Income”

And so on.

**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 Use IF Function to Return Yes or No

Excel: How to Use an IF Function with Range of Values