SlideShare ist ein Scribd-Unternehmen logo
1 von 13
20 Excel Functions to Know and Use Before you Die – The IF Function
Continuing our series of  “20 Functions to Know and Use before You Die” , this time it is the turn of the  IF  function.  Chances are, that in virtually any half decent spreadsheet you open there will be an IF statement. They can vary from a basic test returning a TRUE or FALSE outcome, multiple nested statements through to highly complex array formulas.
One thing they all have in common is that they give you a TRUE or FALSE answer and based on that you can then perform calculations or display a text message. The basic structure of the IF function is; =IF(test, do if TRUE, do if FALSE)
The test part of the function might be to check a value in a cell or to compare various cells e.g. A3 > 200, D5=G5, F2 = “text” etc. If the outcome of the test is TRUE, it then performs the ‘do if TRUE’ part or if the test gives a FALSE outcome it performs the ‘do if FALSE’ part. Note that the FALSE section is optional but if the outcome is FALSE,  Excel  will display the word ‘FALSE’ in the cell.
If we wanted to display the words “Chase customer” if the word “No” appears in column F, our formula would be; =IF(F2=“No”,“Chase customer”,“Paid”)   Test: has the cell to the left got the word “No” in it? Do if TRUE: display the words “Chase customer”   Do if FALSE: display the word “Paid” Note: if you want to display text you must have double speech marks.
If you don’t want to display anything, simply enter “” with no space between the speech marks. The IF statement can then be extended to test multiple cells using AND , OR or NOT.
If we were particularly concerned about late payments on desks and wanted to focus on those our formula might be; =IF(AND(F2=“No”,E2=“Desks”), “Chase customer”,“Not urgent”)
You can also create sets of nested IF statements. You can create up to 7 nested statements to perform multiple subsequent tests. Take the data below. I want to see if the Sales value falls between my  Min  and  Max  values above the table.   In order to test this we would need the following formula; =If($D5>=F$1,IF(($D5<=F$2,$D5,NA()),NA())
The first IF tests whether the sales value (240) is greater than the Min value (100), which is TRUE. It then performs the TRUE portion of the statement which in this case is another IF. This time it tests whether 240 is less than or equal to the Max value (149). This is FALSE, so displays NA(). When the test for both is TRUE, it simply displays the Sales value.
Beyond nested Ifs you are then looking at array formulas, which are a special type of formula that allow you to perform multiple tests on whole ranges of data with a single formula.
Returning to our original data table, I might want to find out total sales on desks or cabinets in both South and West regions. In Excel 2007 and 2010 there are some new functions such as SUMIFS and AVERAGEIFS that allow you to perform multiple criteria SUMIF type calculations but you can do this and other far more complex calculations with an array formula;  {=SUM(IF(((D2:D50=“South”)+( D2:D50=“West”))*((E2:E50= “Cabinets”)+(E2:E50= “Desks”)),D2:D50))}  Note that * and + replace AND and OR in this type of formula.
So next time, have a go at adding an IF statement into your worksheets. You’ll wonder how you ever worked with data without an IF. Next time in this series……VLOOKUP.
    Find out more about Excel courses and tips. Find out more on  Bespoke Training  and  Managed Training Services  on Thales Training and Consultancy

Weitere ähnliche Inhalte

Mehr von Thales Training & Consultancy (13)

I wish I could... Excel Tips
I wish I could... Excel TipsI wish I could... Excel Tips
I wish I could... Excel Tips
 
If only there was an easier way….of creating a series
If only there was an easier way….of creating a seriesIf only there was an easier way….of creating a series
If only there was an easier way….of creating a series
 
Top Tips to Online Learning
Top Tips to Online LearningTop Tips to Online Learning
Top Tips to Online Learning
 
Project Cost and Schedule Control
Project Cost and Schedule ControlProject Cost and Schedule Control
Project Cost and Schedule Control
 
Guide to PRINCE2®
Guide to PRINCE2® Guide to PRINCE2®
Guide to PRINCE2®
 
On course-spring-2011
On course-spring-2011On course-spring-2011
On course-spring-2011
 
Employee Engagement Presentation
Employee Engagement PresentationEmployee Engagement Presentation
Employee Engagement Presentation
 
What is an it course?
What is an it course? What is an it course?
What is an it course?
 
Learning and Skills 2011
Learning and Skills 2011Learning and Skills 2011
Learning and Skills 2011
 
Tips Time Management Presentation
Tips Time Management PresentationTips Time Management Presentation
Tips Time Management Presentation
 
Tips managing projects presentation
Tips managing projects presentationTips managing projects presentation
Tips managing projects presentation
 
Tips communication skills presentation
Tips communication skills presentationTips communication skills presentation
Tips communication skills presentation
 
Assertiveness presentation
Assertiveness presentationAssertiveness presentation
Assertiveness presentation
 

Kürzlich hochgeladen

Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 

Kürzlich hochgeladen (20)

Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 

20 excel functions to know and use before you die – the if function 280611

  • 1. 20 Excel Functions to Know and Use Before you Die – The IF Function
  • 2. Continuing our series of “20 Functions to Know and Use before You Die” , this time it is the turn of the IF function. Chances are, that in virtually any half decent spreadsheet you open there will be an IF statement. They can vary from a basic test returning a TRUE or FALSE outcome, multiple nested statements through to highly complex array formulas.
  • 3. One thing they all have in common is that they give you a TRUE or FALSE answer and based on that you can then perform calculations or display a text message. The basic structure of the IF function is; =IF(test, do if TRUE, do if FALSE)
  • 4. The test part of the function might be to check a value in a cell or to compare various cells e.g. A3 > 200, D5=G5, F2 = “text” etc. If the outcome of the test is TRUE, it then performs the ‘do if TRUE’ part or if the test gives a FALSE outcome it performs the ‘do if FALSE’ part. Note that the FALSE section is optional but if the outcome is FALSE, Excel will display the word ‘FALSE’ in the cell.
  • 5. If we wanted to display the words “Chase customer” if the word “No” appears in column F, our formula would be; =IF(F2=“No”,“Chase customer”,“Paid”) Test: has the cell to the left got the word “No” in it? Do if TRUE: display the words “Chase customer” Do if FALSE: display the word “Paid” Note: if you want to display text you must have double speech marks.
  • 6. If you don’t want to display anything, simply enter “” with no space between the speech marks. The IF statement can then be extended to test multiple cells using AND , OR or NOT.
  • 7. If we were particularly concerned about late payments on desks and wanted to focus on those our formula might be; =IF(AND(F2=“No”,E2=“Desks”), “Chase customer”,“Not urgent”)
  • 8. You can also create sets of nested IF statements. You can create up to 7 nested statements to perform multiple subsequent tests. Take the data below. I want to see if the Sales value falls between my Min and Max values above the table. In order to test this we would need the following formula; =If($D5>=F$1,IF(($D5<=F$2,$D5,NA()),NA())
  • 9. The first IF tests whether the sales value (240) is greater than the Min value (100), which is TRUE. It then performs the TRUE portion of the statement which in this case is another IF. This time it tests whether 240 is less than or equal to the Max value (149). This is FALSE, so displays NA(). When the test for both is TRUE, it simply displays the Sales value.
  • 10. Beyond nested Ifs you are then looking at array formulas, which are a special type of formula that allow you to perform multiple tests on whole ranges of data with a single formula.
  • 11. Returning to our original data table, I might want to find out total sales on desks or cabinets in both South and West regions. In Excel 2007 and 2010 there are some new functions such as SUMIFS and AVERAGEIFS that allow you to perform multiple criteria SUMIF type calculations but you can do this and other far more complex calculations with an array formula; {=SUM(IF(((D2:D50=“South”)+( D2:D50=“West”))*((E2:E50= “Cabinets”)+(E2:E50= “Desks”)),D2:D50))} Note that * and + replace AND and OR in this type of formula.
  • 12. So next time, have a go at adding an IF statement into your worksheets. You’ll wonder how you ever worked with data without an IF. Next time in this series……VLOOKUP.
  • 13.   Find out more about Excel courses and tips. Find out more on Bespoke Training and Managed Training Services on Thales Training and Consultancy