Enrollment for the FMVA™ Certification Program is now OPEN!

IF Statement Between Two Numbers

This article outlines how to use the IF with AND functions in Excel.

How to combine IF with AND functions

In Excel, you can combine IF with AND functions to return a value based on two different numbers.  This can be very useful when performing financial modeling and you are creating conditional situations.  In this article, learn how to build an IF statement between two numbers so you can easily answer the problem you’re trying to solve.

For example, if you are looking for a formula that will go into to cell B2 and, if the number is between 100 and 999 the result will be 100, otherwise if it is outside that range the result will be zero.

Download the Free Excel Template – IF with AND Functions.

 

IF statement between two numbers IF Statement between two numbers

=IF(AND(C6>=C8,C6<=C9),C11,C12)

(See screenshots below)

 

Example of how to use the formula:

Step 1: Put the number in cell C6 you want to test (150).

Step 2: Put the criteria in cells C8 and C9 (100 and 999).

Step 3: Put the results if true or false in cells C11 and C12 (100 and 0).

Step 4: type the formula =IF(AND(C6>=C8,C6<=C9),C11,C12)

 

 

Final result

Here is a screenshot in Excel after using the formula for an IF statement between two numbers. You can clearly see how the result from the example is 100 because the number 150 is between 100 and 999.

 

if statement in Excel with two numbers

 

Congratulations, you have now combined IF with AND between two numbers in Excel!

Download the free template.

 

IF statement between two numbers (with text)

You don’t have to limit the resulting output from the model to only numbers. You can also use text, as shown in the example below.  This time, instead of producing 100 or 0 as the result, Excel can display YES or NO to show if the argument is true or false.

 

if statement between two numbers with text

 

 

More Excel tutorials

Thank you for reading this guide to understanding how to use an IF with AND function in Excel to know if a number is between two other numbers.  To keep learning and developing your career as a financial analyst, these additional resources will help you on your way:

Free Excel Tutorial

To master the art of Excel, check out CFI's FREE Excel Crash Course, which teaches you how to become an Excel power user.  Learn the most important formulas, functions, and shortcuts to become confident in your financial analysis.  

Launch CFI’s Free Excel Course now to take your career to the next level and move up the ladder!