How to combine IF, AND and OR functions to filter data

If you only use the IF function, the AND function and the OR function, you cannot see the full usefulness of these functions in Excel. The following article will combine the IF function, the AND function and the OR function to filter data, process data in Excel, please follow along.

How to combine IF, AND and OR functions to filter data Picture 1

First, the article will present through the syntax of the IF, AND and OR functions, if you do not understand each function, you can refer to the articles at the link below.

IF function syntax

= IF (logical_test; [value_if_true]; [value_if_false])

Inside:

  1. logical_test : an expression that can be TRUE or FALSE.
  2. value_if_true : value you want to return if the logical_test argument is TRUE.
  3. value_if_false : value you want to return if the logical_test argument is FALSE.

You can find an example of the IF function here http://TipsMake.vn/ham-if-trong-excel/

AND function syntax

= AND (logical1; [logical2]; .)

Inside:

  1. logical1 : required argument, the first condition to be returned as a logical value (TRUE or FALSE) or arrays or references containing logical values.
  2. logical2 , .: optional, additional conditions up to 255 conditions.

You can learn more about the AND function here http://TipsMake.vn/ham-and-trong-excel/

OR function syntax

= OR (logical 1; [logical 2]; .)

Inside:

  1. logical 1, logical 2 are logical values ​​(either True or False).
  2. The function contains up to 255 logical values.
  3. The function returns True if one of the arguments has a True value, the function returns False when all of the arguments have a False value.

You can learn more about the OR function here http://TipsMake.vn/ham-or-trong-excel-cach-su-dung-ham-or-va-vi-du-minh-hoa/

Specific examples of combining the IF function, the AND function and the OR function in Excel

Suppose you have the following data table:

How to combine IF, AND and OR functions to filter data Picture 2

You want to calculate the bonus for Sales staff, the bonus is 4% of the total sales provided that Sales> = 80000 or employees in Area 3 with Sales> = 60000.

To do this, in the first cell of the Bonus column, enter the following formula:

= IF (OR (E8> = 80000; AND (D8 = "Area 3"; E8> = 60000)); 0.04 * E8; "No reward")

The condition of the IF function is OR (E8> = 80000; AND (D8 = "Area 3"; E8> = 60000)) if the IF function returns TRUE if either of the conditions in the OR function is true, the AND function returns TRUE if both conditions in the AND function are true.

If the IF function returns TRUE, the employee is rewarded with a bonus of 4% of sales of 0.04 * E8. If the IF function returns FALSE, the string returns 'No reward'.

Your results will be as follows:

How to combine IF, AND and OR functions to filter data Picture 3

Next, copy the function formula down to the cells below to calculate the Bonus for all Salespeople .

How to combine IF, AND and OR functions to filter data Picture 4

Above the article shared how to combine the IF function, the AND function and the OR function in Excel, you can combine the IF function with the AND function or the IF function with the OR function according to the data processing requirements you encounter. To achieve the best effect. Good luck!

5 ★ | 2 Vote

May be interested

  • How to split cells, combine cells in ExcelHow to split cells, combine cells in Excel
    how to split cells, combine cells in excel. on excel spreadsheets, many times you need to split cells, merge cells to fit the data you need to enter. you can combine two or more cells together using excel's built-in functions or use visual basic to merge
  • How to filter duplicate data from 2 Sheets in ExcelHow to filter duplicate data from 2 Sheets in Excel
    how to filter duplicate data from 2 sheets in excel. in excel file, you have data in 2 different sheets but you want to filter duplicate data with a large number of records. here's how to use the vlookup function to filter duplicate data from 2 sheets in exc
  • Filter PivotTable report data in ExcelFilter PivotTable report data in Excel
    teach you how to filter pivottable reports data in excel 2013 accurately and quickly. the original pivottable report created on demand helps you see the entire information of the data. in case you want to statistically follow a field
  • Filter duplicate data, delete duplicate data in ExcelFilter duplicate data, delete duplicate data in Excel
    for excel files with large log volumes, duplication of data is very common. so i introduce to you how to filter duplicated data with tools available in excel.
  • Photoshop CS: Eclipse effectPhotoshop CS: Eclipse effect
    in the previous article, i showed you how to create a color swirl using a few effects from the filter filter. there will be many more interesting things from this filter filter that make sure
  • How to combine Sumif and Vlookup functions in ExcelHow to combine Sumif and Vlookup functions in Excel
    what is the solution when combining sumif and vlookup functions on excel? what types of calculation will require the combination of sumif and vlookup functions?
  • Input & Output in CInput & Output in C
    when we talk about input, we are talking about input data for the program. it can be provided from the command line or from a certain file. program c language provides a set of functions available to read the entered data and provide it for the required programs.
  • What is a filter? How to use Filter in photography?What is a filter?  How to use Filter in photography?
    in photography, filter means glass filters used in many different situations, such as taking photos of low-light natural conditions, or enhancing colors, ...
  • How to combine 2 columns Full name in Excel does not lose contentHow to combine 2 columns Full name in Excel does not lose content
    in excel, to be able to merge content in 2 columns into a single column without losing content, we need to use calculation functions.
  • How to combine 2 or more cells in Excel without losing dataHow to combine 2 or more cells in Excel without losing data
    how to combine 2 or more cells in excel without losing data. when merging cells containing data into 1 cell, excel retains the data in the first cell only, data in the remaining cells are deleted. so to retain all data in the cells you need to merge, you cannot use the feature