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.
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:
- logical_test : an expression that can be TRUE or FALSE.
- value_if_true : value you want to return if the logical_test argument is TRUE.
- 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:
- logical1 : required argument, the first condition to be returned as a logical value (TRUE or FALSE) or arrays or references containing logical values.
- 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:
- logical 1, logical 2 are logical values (either True or False).
- The function contains up to 255 logical values.
- 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:
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:
Next, copy the function formula down to the cells below to calculate the Bonus for all Salespeople .
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!
You should read it
- How to use Filter function on Google Sheets
- Guide to Automatic Filter and Filter detailed data in excel
- Advanced data filtering in Excel
- MS Excel 2007 - Lesson 8: Sort and Filter
- What are the functions of HEPA filter on air purifiers?
- How to filter data in Excel
- Filter data that doesn't overlap in Excel - Filter for unique values in Excel
- How to fix the error of Filter not filtering all the data?
May be interested
- How to split cells, combine cells in Excelhow 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. 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 Excelteach 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 Excelfor 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 effectin 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 Excelwhat 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 Cwhen 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?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 contentin 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. 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