10837 10874 10874 0
How to use IF function with AND, OR, and NOT in Excel?
In Excel, the IF function is quite useful to check whether a cell meets a condition and return different values based on evaluated results (True and False). And combining the IF function and AND, OR, NOT functions, it will vary conditions to check cells. Here I will introduce how to use IF and AND functions, IF and OR functions, and combine multiple IF functions in Excel.
- How to use IF function in Excel
- How to use If function and AND function in Excel
- How to use IF function and OR function in Excel
- How to combine multiple IF functions in one formula in Excel
Supposing we have a sales table as the following screen shot shown, and now we want to evaluate the sale values and group them as "Unordinary", "Low", "Middle", and "High".
And Now copy the row headers and column headers into a blank range (Range A16:E28 in our example) as the following screen shot shown.
How to use IF function in Excel
The basic form of IF function in Excel is shown as: =IF(logic_test, value_if true, value_if_false)
In our case we want to check the sale volumes are Low or not. If the value in Cell B2 is equal or less than 80, return the text of "Low", if the value in Cell B2 is bigger than 80, return blank.
Enter the formula =IF(B2<=80,"Low","") into the Cell B17, and then drag the Fill Handle to the Range B17:E28. See screen shot below:
Easily combine multiple worksheets/workbooks/CSV files into one worksheet/workbook
It may be tedious to combine dozens of sheets from different workbooks into one sheet. But with Kutools for Excel’s Combine (worksheets and workbooks) utility, you can get it done with just several clicks!
Full Feature Free Trial
30-day!
How to use If function and AND function in Excel
If you want to check if a cell meets several conditions at the same time, you can combine the IF function and AND function in Excel.
The basic form of AND function in Excel is =AND(Logical 1, Logical 2, Logical 3, …, etc.)
Now in our case we want to check a sale volume is more than 80 and less than 160 simultaneously, if yes returns the text of "Middle", and if no returns blank.
Enter the formula =IF(AND(B2>80,B2<160),"Middle","") into Cell B17, and then drag the Fill Handle to the Range B17:E28. See screen shot below:
How to use IF function and OR function in Excel
If you want to check if a cell meets one of multiple conditions, you can combine the IF function and OR function in Excel.
The basic form of OR function in Excel is =OR(Logical 1, Logical 2, Logical 3, …, etc.)
In our example, we want to find out the unordinary sale volumes which are bigger than 180 or less than 20. If the sale volumes are unordinary, return the text of "Unordinary", if no return blank.
Enter the formula =IF(OR(B2>180,B2<20),"Unordinary","") into Cell B17, and then drag the Fill Handle to the Range B17:E28. See screen shot below:
How to combine multiple IF functions into one formula in Excel
In our example, if you want to evaluate all sale volumes with one formula, you can apply a complex IF function.
If the sale volume is equal or less than 20, return text of "Unordinary"; if the sale volume is equal or less than 80, return text of "Low"; if equal or less than 160, return text of "Middle", and if equal or less than 200, return text of "High".
Enter the formula =IF(B2<=20,"Unordinary",IF(B2<=80, "Low", IF(B2<=160, "Middle", IF(B2<=200, "High", "")))) into Cell B17, and then drag the Fill Handle to the Range B17:E28. See screen shot below:
![]() |
Formula is too complicated to remember? Save the formula as an Auto Text entry for reusing with only one click in future! Read more… Free trial |
The Best Office Productivity Tools
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
- Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
- Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
- Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
- Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
- Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
- Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
- Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
- Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
- More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
