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 ⋙

Leave a Comment

TRUNC Function: How to remove decimals and shorten numeric values

TRUNC Function: How to remove decimals and shorten numeric values

There are different ways in Excel to remove decimals and shorten numeric values. In this article, Quantrimang.com will explain how to use the TRUNC function and point out what makes it different from other techniques.

SUBTOTAL Function: Calculates the total value of a filtered list in Excel

SUBTOTAL Function: Calculates the total value of a filtered list in Excel

The sum function when filtering data is very important for Microsoft Excel users. This article will summarize for you how to filter and calculate sum in Excel using Subtotal.

How to Export Airtable to Excel and Google Sheets

How to Export Airtable to Excel and Google Sheets

Airtable lets you create and share relational databases easily. Export your Airtable data to Google Sheets or Excel to enjoy the benefits of advanced charts and data visualization.

Effective ways to use ChatGPT in Excel

Effective ways to use ChatGPT in Excel

Curious about how ChatGPT can enhance your Excel experience? Here are some tips for using ChatGPT in Excel.

How to use the WORKDAY function in Microsoft Excel

How to use the WORKDAY function in Microsoft Excel

In Microsoft Excel, the WORKDAY function is a date and time function and its purpose is to return the date before and after the specified number of working days. Working days do not include weekends or any days defined as holidays.

Why are so many people stopping using Google Sheets and going back to Excel?

Why are so many people stopping using Google Sheets and going back to Excel?

For a while, Google Sheets lured people away from Excel. But many people came back after realizing that Google Sheets is far from beating Excel.

How to use the TREND function in Excel

How to use the TREND function in Excel

You can calculate and visualize trends in Excel using the TREND function. Here's how to use the TREND function in Microsoft Excel.

How to enable and disable macros on Excel

How to enable and disable macros on Excel

The following article will guide readers how to enable and disable macros in Excel 2007, 2010, 2013 and 2016.

How to fix the error of printing blank pages in Microsoft Excel

How to fix the error of printing blank pages in Microsoft Excel

How to fix the error of printing blank pages in Microsoft Excel. Why do some Excel documents not display data or contain blank pages when printed? Below are the reasons

How to pin Word, Excel and PowerPoint files to the corresponding app icon on the Windows 11 taskbar

How to pin Word, Excel and PowerPoint files to the corresponding app icon on the Windows 11 taskbar

How to pin Word, Excel and PowerPoint files to the corresponding app icon on the Windows 11 taskbar, How to pin Office files to the taskbar icon on Windows 11? Invite

How to fix the error of not being able to save Excel files on Windows

How to fix the error of not being able to save Excel files on Windows

How to fix the error of not being able to save an Excel file on Windows. If you can't save the Excel file, don't worry too much. Below are ways to fix the error of not being able to save the above Excel file

How to insert a picture into a cell using VBA in Excel

How to insert a picture into a cell using VBA in Excel

How to insert a picture into a cell using VBA in Excel, You can easily insert pictures into Excel spreadsheets and edit them with macro code. Here's how to insert images

How to enable auto-capitalization of the first letter of a sentence in Excel

How to enable auto-capitalization of the first letter of a sentence in Excel

How to enable auto-capitalization of the first letter of a sentence in Excel, Turning on the automatic-capitalization of the first letter of a sentence in Excel will save you a lot

How to calculate seniority work on Excel spreadsheets

How to calculate seniority work on Excel spreadsheets

Through this tutorial, WebTech360 will guide you how to calculate the seniority of a list of employees in the company via Microsoft Excel spreadsheet or WPS Spreadsheets.

How to Use Bixby Routines on Samsung

How to Use Bixby Routines on Samsung

Bixby Routines on Samsung uses AI technology to perform automated actions like automatically muting, turning on night mode, and turning off mobile data on your Samsung phone at night…

Android is about to support a new anti-theft protection feature, whats interesting?

Android is about to support a new anti-theft protection feature, whats interesting?

Smartphones are now considered an “inseparable item” for many people. However, it is not uncommon for us to accidentally lose our phones, or worse, have them stolen.

Why do some people find hour-long YouTube ads unskippable?

Why do some people find hour-long YouTube ads unskippable?

It only takes a few seconds for the skip ad button to appear on a YouTube video, but sometimes that wait can feel like an eternity.

Dont fall for these Reddit scams that are waiting to install malware on your computer!

Dont fall for these Reddit scams that are waiting to install malware on your computer!

The infamous Lumma Stealer malware is back with a new campaign, ready to steal your data.

Interesting photo series to help you understand how the world around us works?

Interesting photo series to help you understand how the world around us works?

These interesting images below will help you understand more about how the world around you works every day.

Surface of Venus: Why is Venus the hottest planet in the solar system?

Surface of Venus: Why is Venus the hottest planet in the solar system?

What is the hottest planet in the solar system? If you want to know which is the hottest star in the solar system, this article will give you the answer.

5 Precautions When Using a Browser Password Manager

5 Precautions When Using a Browser Password Manager

If you follow these password security tips, your browser-based password manager will be just as secure as a paid alternative.

Lien Quan badge change event April 2025

Lien Quan badge change event April 2025

The monthly Lien Quan badge exchange event helps players receive cool skins. Let's find out what skins are available this month.

Latest Hello Cafe VNG Code and how to enter code

Latest Hello Cafe VNG Code and how to enter code

We will bring you a list of Hello Cafe giftcodes for you to redeem codes and receive rewards at the beginning of the game.

Cheat Aoe 2, Aoe 2 code all full versions

Cheat Aoe 2, Aoe 2 code all full versions

Here are the full Age of Empires codes and how to use AOE 2 codes in the game.

How to Create Animated Sound Using Adobe Express

How to Create Animated Sound Using Adobe Express

If you are not a professional artist, Adobe Express can help you a lot in creating animated characters, or even creating voices for animated characters.

How to Use ChatGPT Search Like a Pro

How to Use ChatGPT Search Like a Pro

Whether you're troubleshooting a technical issue or digging deep into research, ChatGPT Search can be surprisingly effective.

Answer to guess the birthday general of Lien Quan, Test your ability to guess the general of Lien Quan April 25, 2025

Answer to guess the birthday general of Lien Quan, Test your ability to guess the general of Lien Quan April 25, 2025

One of the events for the 7th birthday of Lien Quan Mobile is the Lien Quan General Guessing Contest. If you guess the questions correctly in this event, players will receive points to exchange for S.

Latest Steel Heart Mecha Code and how to redeem code

Latest Steel Heart Mecha Code and how to redeem code

The latest Steel Heart Mecha Code gives players currency, gold tickets along with other rewards such as character EXP.

Many YouTubers Sell Unused Video Footage to AI Companies

Many YouTubers Sell Unused Video Footage to AI Companies

Many YouTubers and other digital content creators are selling their unused video footage to Artificial Intelligence (AI) companies looking for exclusive videos to better train their AI algorithms.