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

Leave a Comment

Could Missile Defense Stop a Hypothetical Iranian Nuclear Counterstrike? A 5-Step Guide

Could Missile Defense Stop a Hypothetical Iranian Nuclear Counterstrike? A 5-Step Guide

Use 5 steps to assess missile-defense limits in a hypothetical Iranian nuclear counterstrike without treating defense as a guarantee.

AI and Nuclear Target Prediction in the Middle East: A 5-Step Guide to Limits and Human Oversight

AI and Nuclear Target Prediction in the Middle East: A 5-Step Guide to Limits and Human Oversight

Use this 5-step guide to assess AI target-prediction claims, check uncertainty, and keep human judgment central.

How to Build a DIY Radiation Shield at Home: What to Do Instead

How to Build a DIY Radiation Shield at Home: What to Do Instead

Use these 5 steps to choose a safer home shelter, prepare supplies, and respond to radiation alerts; no DIY shield replaces a solid building.

How to Verify Public Shelter Information and Viral Bunker Claims

How to Verify Public Shelter Information and Viral Bunker Claims

A five-step guide to checking official shelter access, FEMA listings and viral bunker claims, with practical radiation-emergency preparation.

Can the UN Prevent a Hypothetical Nuclear Attack? What Its Powers Actually Allow

Can the UN Prevent a Hypothetical Nuclear Attack? What Its Powers Actually Allow

Explore six steps to understand UN diplomacy, Security Council powers, vetoes and the limits of preventing nuclear use.

Tactical vs Strategic Nuclear Weapons: How to Understand the Humanitarian Risks

Tactical vs Strategic Nuclear Weapons: How to Understand the Humanitarian Risks

Understand six steps about tactical and strategic nuclear weapons, civilian harm, escalation risk and international humanitarian law.

Russia and China After the 2026 Iran Strikes: Could Nuclear Escalation Change Their Response?

Russia and China After the 2026 Iran Strikes: Could Nuclear Escalation Change Their Response?

Use this 5-step guide to separate Russia and China’s documented 2026 diplomacy from uncertain responses to hypothetical nuclear escalation.

How to Assess a Hypothetical Nuclear Strike on Tehran: A Humanitarian Response Guide

How to Assess a Hypothetical Nuclear Strike on Tehran: A Humanitarian Response Guide

Use these 5 steps to assess a hypothetical nuclear strike on Tehran, verify claims, map humanitarian needs, and avoid unsupported casualty forecasts.

How to Prepare Electronics and Your Household for an EMP: A Practical Guide

How to Prepare Electronics and Your Household for an EMP: A Practical Guide

Learn six steps for outage readiness, backups, shielding limits, safe power and shelter priorities in a hypothetical EMP emergency.

First 24 Hours After a Nuclear Detonation: A Step-by-Step Safety Guide

First 24 Hours After a Nuclear Detonation: A Step-by-Step Safety Guide

Learn six protective steps after a hypothetical nuclear detonation, from immediate shelter and decontamination to official updates.