Excel function learning: three multi-conditional logic functions AND(), OR(), IF()
In the previous article "The omnipotent SUMPRODUCT for Excel function learning! 》, we learned the SUMPRODUCT function. Today we are going to talk about three multi-conditional logic functions AND(), OR(), and IF(). Let’s take a look at the explanation together!
For those who are new to functions, you don’t need to understand complex function formulas right away, but you must understand these three multi-conditional logic functions: AND, OR, IF , these three functions can be said to be the most frequently used when writing nested formulas.
Each function is like a calculator. Each calculator has its own special functions. We only need to follow the rules of the calculator and enter data in the corresponding parameter position, and the calculator will automatically complete the function. Special operations. Look at how cumbersome the formula we entered using operators last time is. With functions, we can simplify our thinking process.
1. AND function
In the table shown below, Bottle wants to find out who are the design interns in the design department. This can be done directly using the filtering function of Excel, but today we are going to learn to use functions to solve problems.
Let’s analyze it first. To find a design intern in the design department, two conditions need to be met: “Column D = design” and “column E = design intern”, and Both conditions must be true at the same time (the last tutorial talked about returning true when the result of the comparison operation is true, and the equal sign is also a comparison operator). So how do we use a formula to express that two conditions need to be true at the same time for the result to be true?
You only need to add a * (multiplication sign) between the two conditions, that is (column D = design) * (column E = design intern). When both are true, the multiplication result is 1, which means that he is a design intern in the design department; when any one of them is false, the result is 0, which means he is not a design intern in the design department.
Enter the formula =(D:D= "Design")*(E:E="Design Intern") in cell I2, press Enter and double-click the lower right corner of cell I2 to fill in the formula. You can see that the I3 result is 1, that is, the Hu Tutu in the third row meets the search conditions.
As you can see, if no one tells you the above method, you will need to turn your head twice more to think of it. In fact, we can directly use the AND function to solve the problem, simplifying the thinking process.
AND (parameter 1, parameter 2...)
, when parameter 1 and parameter 2 are both true, the result is true.
Select cell I2 and enter the formula in the edit bar =AND (D:D="Design", E:E="Design Intern")
Then press Enter, you can see that the I2 formula result is FALSE. Place the mouse on the lower right corner of cell I2 and double-click to fill in the formula. You can see that only cell I3 is true. The design intern we are looking for is Hu Tutu in row 3.
2. OR function
If you want to find the HR specialist or HR manager, just find any Just one person.
The previous bottle used multiplication to ensure that two conditions are met at the same time. Now you can use addition to ensure that any one condition is met.
(Column E=Human Resources Manager) (Column E=Human Resources Specialist)
, as long as one of them is true, the result of the addition is 1; when both are false, the result is 0.
Enter the formula =(E:E="Personnel Manager") (E:E="Personnel Specialist")
in cell I2, press Enter and double-click the lower right corner of cell I2 to fill in formula. You can see that I4 and I7 result in 1.
Similarly, we can also use OR to solve this problem.
OR (parameter 1, parameter 2...)
, two parameters, if any one is true, the result is true, if both are false, the result is FALSE.
Enter the formula in cell I2 =OR (E:E="Personnel Manager", E:E="Personnel Specialist")
, press Enter, double-click to fill in the formula, the results are as follows , the same lines 4 and 7 are true.
3. IF function
The first two functions are judgment functions and can only judge parameters Whether it is true or false, the output results are only true and false. If the bottle wants to directly output the person's name, it needs to be nested using the IF function.
IF function has three parameters, IF (condition, return value when the condition is true, return value when the condition is false), parameter 1 represents the condition, in the first case above, the condition is the design internship of the design department Health; when the result is true, parameter 2 is returned, which is the corresponding name; when the result is false, parameter 3 is returned, which means that it is not the person you are looking for, so we set the return to blank.
Based on the above analysis, we can write the formula in cell I2
=IF(and(D:D="Design",E:E="Design Internship Raw"),B:B," ")
, double-click to fill.
In the same way, we can write the formula for the second case.
=IF (OR (E:E="Human Resources Manager", E:E="Human Resources Specialist"),B:B," ")
, double-click to fill. The results are as follows.
Okay, that’s it for today’s course. In order to test your learning effect, I’ll leave you with a question below.
As shown below, the boss is going to distribute a subsidy to everyone, and the subsidy will be distributed according to the number of years of service. So how to write the formula for the subsidy column?
Just use the IF function you learned earlier to solve the problem. Although it is not the easiest way to solve the problem, it can train everyone's hands, especially the formulas require Chinese and English. When switching, and when some characters need to be enclosed in double quotes, errors are most likely to occur. Function experts can also think about whether there is a simpler function that can solve the problem!
Related learning recommendations: excel tutorial
The above is the detailed content of Excel function learning: three multi-conditional logic functions AND(), OR(), IF(). For more information, please follow other related articles on the PHP Chinese website!

This tutorial explains how to calculate the median of numerical data in Excel using the MEDIAN function. The median, a key measure of central tendency, identifies the middle value in a dataset, offering a more robust representation of central tenden

Master Google Sheets COUNTIF: A Comprehensive Guide This guide explores the versatile COUNTIF function in Google Sheets, demonstrating its applications beyond simple cell counting. We'll cover various scenarios, from exact and partial matches to han

This tutorial provides a comprehensive guide to sharing Excel workbooks, covering various methods, access control, and conflict resolution. Modern Excel versions (2010, 2013, 2016, and later) simplify collaborative editing, eliminating the need to m

This tutorial explores various methods for converting .xls files to .jpg images, encompassing both built-in Windows tools and free online converters. Need to create a presentation, share spreadsheet data securely, or design a document? Converting yo

This tutorial clarifies the function of Excel names and demonstrates how to define names for cells, ranges, constants, or formulas. It also covers editing, filtering, and deleting defined names. Excel names, while incredibly useful, are often overlo

This tutorial clarifies the distinction between standard deviation and standard error of the mean, guiding you on the optimal Excel functions for standard deviation calculations. In descriptive statistics, the mean and standard deviation are intrinsi

This Excel tutorial demonstrates how to calculate square roots and nth roots. Finding the square root is a common mathematical operation, and Excel offers several methods. Methods for Calculating Square Roots in Excel: Using the SQRT Function: The

Unlock the Power of Google Sheets: A Beginner's Guide This tutorial introduces the fundamentals of Google Sheets, a powerful and versatile alternative to MS Excel. Learn how to effortlessly manage spreadsheets, leverage key features, and collaborate


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SublimeText3 Linux new version
SublimeText3 Linux latest version

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Zend Studio 13.0.1
Powerful PHP integrated development environment

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.