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 ⋙

How To Find Quality And Fast Internet In Montreal

How To Find Quality And Fast Internet In Montreal

Montreal, a city brimming with culture, history, and Poutine (a famous Canadian dish), deserves an internet connection that can keep up. Whether you’re a streamer glued to Twitch, a workaholic juggling video conferences, or a casual web surfer, a reliable and fast internet plan is essential.

What is ChatGPT? Why did it create a global craze?

What is ChatGPT? Why did it create a global craze?

What is ChatGPT? Why is it creating a global fever? In recent days, the ChatGPT chatbox is creating a global craze. Not only that ChatGPT is creating

Google Drive for desktop will be discontinued in March 2018

Google Drive for desktop will be discontinued in March 2018

Google Drive for desktop will be discontinued in March 2018, Google has officially announced that it will stop supporting Google Drive for desktop and then the company will remove the application.

The latest Adobe Flash Player update contains virtual currency mining malware

The latest Adobe Flash Player update contains virtual currency mining malware

The latest Adobe Flash Player update contains virtual currency mining malware, researchers from security firm Palo Alto Networks warn users if they download the wrong update

One Ordinary Day - Movie schedule An ordinary day

One Ordinary Day - Movie schedule An ordinary day

One Ordinary Day - Movie schedule One Ordinary Day, One Ordinary Day (Vietnamese name: One Ordinary Day) is an attractive Korean film about a crime topic.

Simple ways to fix AirDrop not working error

Simple ways to fix AirDrop not working error

Simple ways to fix AirDrop not working error, AirDrop not working on iPhone, iPad, Mac what to do? This article will provide you with simple ways

Status of opening new school year 2023 - 2024

Status of opening new school year 2023 - 2024

Status for opening the new school year 2023 - 2024, TOP 50 Status for opening the new school year 2023 - 2024 to help you freely choose unique statuses and statuses for yourself!

Top photo editing applications similar to Snap Camera

Top photo editing applications similar to Snap Camera

Top photo editing applications similar to Snap Camera, Snap Camera is a free camera application that helps apply Snapchat filters. In addition to Snap Camera, you can refer to these

Ways to fix file attachment errors on Gmail

Ways to fix file attachment errors on Gmail

Ways to fix file attachment errors on Gmail, Why can't I download files in Gmail? Why can't you attach files to Gmail? Here are the causes and how

Is it safe to use public Wifi?

Is it safe to use public Wifi?

Is it safe to use public Wifi?, Public Wifi helps you connect to the Internet for free. However, is it safe to use public wifi? Join WebTech360

TOP best computer screen recording software 2024

TOP best computer screen recording software 2024

TOP best computer screen recording software 2024, Which is the best lightweight, free, high-quality computer screen recording software? Let's find out the top with WebTech360

Tips for using Google Chrome that students need to know

Tips for using Google Chrome that students need to know

Tips for using Google Chrome that students need to know, Google Chrome is the most popular web browser today. You probably already know how to use it, however, if

Please upgrade TeamViewer immediately or your computer will be hijacked

Please upgrade TeamViewer immediately or your computer will be hijacked

Please upgrade TeamViewer immediately or your computer will be hijacked. Teamviewer has just released an emergency patch that allows hackers to take control of your computer.

Should you use Tor and VPN at the same time?

Should you use Tor and VPN at the same time?

Should you use Tor and VPN at the same time? Tor and VPN both provide privacy protection but in different ways. So should privacy and security features be combined?

Signs of a fake Instagram account

Signs of a fake Instagram account

Signs of a fake Instagram account. Are you wondering whether the Instagram account you are following or contacting is genuine or legitimate? Signs below

Explore BlueStacks X on PC

Explore BlueStacks X on PC

Explore BlueStacks X on PC, BlueStacks X allows you to open Android games using cloud computing on your web browser. With BlueStacks X, you are no longer limited

Play Fish Drop game online on My Viettel and receive free data packages, voice calls, and SMS

Play Fish Drop game online on My Viettel and receive free data packages, voice calls, and SMS

Play Fish Release game online on My Viettel to receive free data packages, voice calls, SMS, Viettel's Online Fish Release program will take place from January 30, 2021 to

Unreal Engine 5: All information about the latest game development technology

Unreal Engine 5: All information about the latest game development technology

Unreal Engine 5: All information about the latest game development technology, Unreal Engine 5 is the latest version of the famous game development tool Unreal Engine of

What is an email address? How to get an email address?

What is an email address? How to get an email address?

What is an email address? How to get an email address?, What is an email address? What is email address entry? This article will answer all your related questions

Every WhatsApp shortcut for computer you need to know

Every WhatsApp shortcut for computer you need to know

Every WhatsApp shortcut for your computer you need to know, WhatsApp is one of the most popular free messaging apps today. The keyboard shortcuts below will help