IF and IFS functions in Excel: Usage and specific examples

Video IF and IFS functions in Excel: Usage and specific examples

The IF and IFS functions in Microsoft Excel are two of the logical functions used quite commonly for Microsoft Office users . In simplest terms, the IF / IFS function will return results based on one or several input comparison data.

Note :For examples and syntaxes of the IF and IFS functions below, we use a semicolon ( ; ) to separate, if in case the function reports an error or no output, please replace the semicolon ( ; ) with a comma ( , ).

IF function in Excel

With the IF function in Excel, you can perform a lot of different calculations including conditional formatting. For example, you can use it as an IF to classify students based on GPA, use the IF function to calculate numbers ...

An IF statement will return two results including the first one if the condition is TRUE, and the second one will be executed for the remaining conditions (FALSE).

IF function syntax

= IF ( Condition ; Do something if condition is true ; Do something with the other case )

If the above formula makes you confusing, please refer to the usage and the IF function examples in the content below. 

Some examples in using the IF function

  • The IF function compares text (example): in the example below, cell D2 says: IF (C2 = Yes , then return 1 , otherwise return 2)

IF and IFS functions in Excel: Usage and specific examples

  • The IF function compares numbers: for example, in cell D2 says: IF (C2 = 1 , then returns Yes , otherwise returns No )

IF and IFS functions in Excel: Usage and specific examples

  • The IF function is larger than:

IF and IFS functions in Excel: Usage and specific examples
The formula in cell D2 will be: = IF (C2> B2; "Over Budget"; "In Budget")

  • The IF function returns the result of a mathematical calculation:

IF and IFS functions in Excel: Usage and specific examples
The formula in cell D2 will be: = IF (C2> B2; C2-B2; 0)

Use the IF function to check if a cell is blank

Sometimes you need to check if a cell is empty or not, usually because you don't want a formula to display the result without input. In this case, we will use the IF function together with the ISBLANK function :

IF and IFS functions in Excel: Usage and specific examples
The formula in cell D2 will be: = IF (ISBLANK (D2); "Blank"; "Not Blank")

In the next example, we will use "" instead of the ISBLANK function. The "" sign essentially means "nothing".

IF and IFS functions in Excel: Usage and specific examples
The formula in cell E2 is = IF (D3 = ""; "Blank"; "Not Blank")

In addition, the following is an example of a common method using "" to prevent a formula from performing calculations if an independent cell is empty:

= IF (D3 = ""; ""; Formula)

Explanation : IF (D3 has nothing, it returns no results, otherwise calculates your formula).

IF function nested to combine multiple conditions

While the simple IF function only has two results ( True or False ), the nested IF function can have 3 to 64 results.

= IF (D2 = 1; "YES"; IF (D2 = 2; "No"; "Maybe")

IF and IFS functions in Excel: Usage and specific examples

Explain the formula in cell E2: IF (D2 = 1 then return "Yes", otherwise IF (D2 = 2 then return "No", otherwise return "Perhaps") . Note that there are two closing parentheses at the end of the formula to complete both IF functions. If you try to enter a formula without both parentheses, Excel automatically adds the last closing parenthesis for you.

IFS function in Excel

If the IF function alone is enough to use the basic conditions, IFS will make you feel better because IFS will combine multiple IF functions in a single IFS. In other words, instead of using multiple nested IFs, you only need to use IFS.

IFS function syntax

= IFS ( Condition 1 ; Value if DK1 is correct ; Condition 2 ; Value if DK2 is correct ; Condition 3 ; Value if DK3 is true ; .............)

The IFS function can test up to 127 different conditions, but you should not nest too many conditions because it will be difficult to check if errors or data conflicts occur.

Example using IFS function

IF and IFS functions in Excel: Usage and specific examples

The formula for the cells in column B is: = IFS (A2> 89; "A"; A2> 79; "B"; A2> 69; "C"; A2> 59; "D"; TRUE; "F" )

Does that mean:

  • If cells A2> 89, enter A
  • If cell A2> 79, enter B
  • If cell A2> 69, enter C
  • If cells A2> 59, enter D
  • and in other cases, fill in F
Sign up and earn $1000 a day ⋙

Iris in Free Fire: Skills, weapons, skill combos

Iris in Free Fire: Skills, weapons, skill combos

Iris in Free Fire: Skills, weapons, skill combos, Iris is the newest female character in Free Fire OB35, with the ability to break the meta. Here's everything you need to know

What should I do if Netflix is ​​hacked?

What should I do if Netflix is ​​hacked?

What should I do if my Netflix account is hacked? What should I do if my Netflix account is hacked? Here's what you need to know when your Netflix account is hacked.

Tips for using LDPlayer you may not know

Tips for using LDPlayer you may not know

Tips for using LDPlayer you may not know. LDPlayer is one of the most popular Android emulators on computers today. This article will provide it to you

Shortcuts in Blender that users need to know

Shortcuts in Blender that users need to know

Shortcuts in Blender that users need to know. Blender shortcuts help you work faster when designing graphics. Therefore, WebTech360 will synthesize the keys for you

Kahoot hacking tips you may not know

Kahoot hacking tips you may not know

Kahoot hacking tips you may not know, how to hack Kahoot to get answers to difficult questions? This article will suggest you some of the simplest Kahoot hacks.

What is Google TasksBoard?

What is Google TasksBoard?

What is Google TasksBoard?, Google TasksBoard is a new task management app, helping you increase work efficiency. Let's learn with Donwload.vn how to use Google TasksBoard

Is Google Takeout a good data backup option?

Is Google Takeout a good data backup option?

Is Google Takeout a good data backup option?, Google Takeout comes from a line of free services from Google. Google says it will help users download it

Host permissions and how to specify co-host in Zoom

Host permissions and how to specify co-host in Zoom

Host rights and how to designate co-host in Zoom. How to regain host rights on Zoom is not difficult. This article will introduce you to host and reclaim host details

6 steps to become a Pinterest expert

6 steps to become a Pinterest expert

6 steps to become a Pinterest expert, Pinterest is a tool for collecting, organizing, and sharing photos and videos you glean from the Internet. Here are 6

3 ways to edit sunsets in Photoshop

3 ways to edit sunsets in Photoshop

3 ways to edit sunset in Photoshop, Sunset is always a scene that every photographer wants to capture. However, taking sunset photos is not easy. Wear

Convert text to speech online

Convert text to speech online

Convert text to speech online. If you want to listen to the pronunciation on Google Translate or Google Translate, users can download this voice to your computer easily.

(2024) The Best Free Cloning Software for Windows 10/11

(2024) The Best Free Cloning Software for Windows 10/11

Are you looking for the free cloning software for Windows 10? This passage will share you the best free Windows 10/11/7 cloning software in 2024.

Steps to create a new database in Access

Steps to create a new database in Access

Steps to create a new database in Access, Steps to create a new database in Microsoft Access are not difficult. This article will guide you in detail on the steps to build muscle

3 ways to save files better on your computer

3 ways to save files better on your computer

3 better ways to save files on your computer, How to save files on your computer is not difficult. However, what is the best way to save on the computer? Let's find out with Dowload.vn

10 poems for the first day of school in 2023 - 2024

10 poems for the first day of school in 2023 - 2024

10 poems for the opening day of school in 2023 - 2024, TOP 10 short and unique poems for the opening day of the new school year. We invite you to follow along!

Things you should do first when buying a Samsung smartphone

Things you should do first when buying a Samsung smartphone

Things you should do first when buying a Samsung smartphone, Samsung phones contain a lot of applications and settings. Here are the settings you should do when

The easiest ways to create borders for photos

The easiest ways to create borders for photos

The easiest ways to create borders for photos, Adding frames to photos is not difficult and you have a lot of options. This article will summarize for you ways to add frames to beautiful photos

Office 2021 vs. Microsoft 365: Which software is right for you?

Office 2021 vs. Microsoft 365: Which software is right for you?

Office 2021 vs. Microsoft 365: Which software is right for you?, Office 2021 and Microsoft 365 can both meet office editing tasks. So Office 2021

Gemini - Googles artificial intelligence model

Gemini - Googles artificial intelligence model

Gemini - Google's artificial intelligence model, Google launches Gemini - an artificial intelligence model competing with OpenAI's GPT-4, this is an artificial intelligence model

What is rendering?

What is rendering?

Rendering is the process of creating an image from a model into a movie scene or image using computer software.