SlideShare a Scribd company logo
If and Nested IFs
@ntudigital
BLOG blogs.ntu.ac.uk/digital_practice
Getting to your session work files
1. Go to your laptopโ€™s desktop
2. Click the folder link to tdu-courses$ to open
Open the Excel Courses > IF and NESTED IF folder
Open the Excel IF formulas.xlsx file.
Any of the files can be opened in a Read only condition.
They can't be re-saved into this folder. If you want to keep them
then save them to your H drive.
You can also locate these files from your work computer:
In a browser enter: opeltdu-courses$
Logistics
โ€ข Toilets
โ€ข Drinks and Refreshments
โ€ข Fire Alarms
โ€ข Questions
http://www.flickr.com/photos/major_clanger/382513/
http://www.flickr.com/photos/tonytoo/4692186465/
About the IF Function
The IF function does something based on a decision
โ€ข If this condition is TRUE do this thing
โ€ข If it is FALSE then do a different thing
Format: It is expressed in a formula
=IF( Condition,Do this if true,Do this if false )
= IF
( )
..,..,..
Equals means itโ€™s a formula with the IF function
Brackets always come in pairs
Must have commas to separate the 3 arguments
Parts:
Simple IF formulas
=IF(A12=0, 35, 0)
The value in this cell If FALSE
In cell A10: evaluating numbers
If TRUE
Simple IF formulas
=IF(A12<=D20, 35, 0)
In cell A10: compare cell values arithmetically
Simple IF formulas
In cell A10: evaluating text
=IF(A12 = โ€œPassโ€, โ€œPartyโ€, โ€œTry againโ€)
Simple IF formulas
In cell A10: cells can have empty or 0 as a result
=IF(A12 = โ€œPassโ€, โ€œPartyโ€, โ€œโ€)
=IF(A12 = โ€œPassโ€, โ€œPartyโ€, 0)
Result if FALSE:
Result if FALSE:
(empty cell)
(zero in cell)
Exercise 1: IF exercises
See workbook: Simple IF exercise
Excel: Simple IFs tab
Nested IFs โ€“ these notes are in your workbook
โ€ข IFs are limited to 2 options
โ€ข Nested IFs allow multiple options
โ€ข They can be long formulas but their principles are the same:
โ€ข There is only 1 equals sign
โ€ข Each IF condition is tested for true from left to right
โ€ข Use commas carefully
โ€ข You must have an equal number of opening and closing
brackets
โ€ข Add no spaces between the parts of the formula
โ€ข Formulas are not case sensitive
โ€ข The formula tests for the 1st true result, then exits
Nested IFs - format
This is where the next condition goes
=IF( , , )
IF( , , ))=IF( , ,
Note:
โ€ข An equal number of open & closing brackets
โ€ข There is only one equals sign
True?
True? True? False
Nested IFs - format
=IF(A12<50,โ€œFailโ€, )
This is where the next condition goes โ€“ after the comma
=IF(A12>69,โ€œHigh passโ€, )
=IF(A12<50,โ€œFailโ€, IF(A12>69,โ€œHigh passโ€,โ€œPassโ€))
2 IF conditions
Nested IFs โ€“ repeating format
= IF( , , IF( , , โ€ฆ
IF( , , IF( , , โ€ฆ
IF( , , IF( , , โ€ฆ
IF( , , , )))))))
True? True?
True? True?
True? True?
True? False
Nested IFs โ€“ note the order of the evaluation
=IF(A12>80,โ€œdistinction passโ€, โ€ฆ
IF(A12>70,โ€œhigh passโ€, โ€ฆ
IF(A12>60,โ€œgood passโ€, โ€ฆ
IF(A12>=50,โ€œpassโ€, โ€ฆ
โ€œfailโ€))))
Exercises โ€“ Nested IF exercises
See workbook: Nested IFs Exercises
Excel: Nested IFs tab
AND & OR nested IFs โ€“ for information only
=IF(Cond1, is true, IF(cond2, is trueโ€ฆ,false))
The nested format we have used up to now is OR
OR
The nested format for AND
=IF(Cond1,IF(Cond2,โ€both agreeโ€,โ€no agreementโ€))
AND
โ€“ these notes are in your workbook
SUMIF function โ€“ version 1 has 2 arguments
=SUMIF(B1:B4,20)
If a cell in the range satisfies the condition, then add it
B
21
12
20
29 =SUMIF(B1:B4,โ€œ>20โ€)
Result: 20
Result: 50
Note: If an argument contains text(<) it is enclosed in double quotes
SUMIF function โ€“ version 2 has 3 arguments
=SUMIF(A1:A4,โ€Redโ€,B1:B4)
If a cell in the range satisfies the condition, then the values
in a different column of the same row are added
A B
Red 21
Green 12
Blue 20
Red 29
Result: 50
SUMIFS function โ€“ for multiple conditions
=SUMIFS(B1:B4,A1:A4,โ€Redโ€,C1:C4,โ€OKโ€)
Similar to SUMIF but allows agreement of multiple criteria.
If ALL are true then add Sum-range cell content to total
Result: 21
A B C
Red 21 OK
Green 12
Blue 20 OK
Red 29
If TRUE If TRUESUM this &
Exercises โ€“ SUMIF and SUMIFS exercises
See workbook: SUMIF and SUMIFS exercises
Excel: SUMIF and SUMIFS tabs
COUNTIF functions โ€“ 2 arguments only
=COUNTIF(B1:B4,20)
If a cell in the range satisfies the condition, then count it
B
21
12
20
29 =COUNTIF(B1:B4,โ€œ>20โ€)
Result: 1
Result: 2
NOTE: Wildcard character searching: missing letters e.g. G**gle
COUNTIFS function - multiple conditions
=COUNTIFS(A1:A4,โ€œredโ€,C1:C4,โ€OKโ€)
Similar to COUNTIF but allows for multiple criteria.
If ALL are true then adds 1 to count total
Result: 1
A B C
Red 21 OK
Green 12
Blue 20 OK
Red 29
Exercises โ€“ COUNTIF and COUNTIFS exercises
See workbook: COUNTIF and COUNTIFS
Excel: COUNTIF and COUNTIFS tabs
Excel Training @NTU
CPLD offers a series of Excel courses aimed to support your development
โ€ข Spreadsheet Features (basic)
โ€ข Conditional Formatting
โ€ข Data Validation
โ€ข Find & Replace
โ€ข Pivot tables
โ€ข Sorting and Filtering
โ€ข Trimming, joining & selecting data
โ€ข Creating visually effective spreadsheets *new
โ€ข VLOOKUP
For booking a place on these course or to arrange a 45 min 1 to 1 Surgery
session go to the CPLD website:
www.ntu.ac.uk/CPLD and look for the link to programme of events
Office Central
08 June 2016 26
https://now.ntu.ac.uk/d2l/home/295527
08 June 2016 27
Office Surgeries
http://ntu.ac.uk/apps/cpld/cpld_events/UI/events.aspx?&page=1&cat=2&kw=Office%
20Surgery

More Related Content

What's hot

Spreadsheet new
Spreadsheet newSpreadsheet new
Spreadsheet new
ShouaQureshi
ย 
SQL JOIN
SQL JOINSQL JOIN
SQL JOIN
Ritwik Das
ย 
Excel functions formulas
Excel functions formulasExcel functions formulas
Excel functions formulas
LearnIT@UD
ย 
SQL JOINS- Reena P V
SQL JOINS- Reena P VSQL JOINS- Reena P V
SQL JOINS- Reena P V
Dipayan Sarkar
ย 
Joins And Its Types
Joins And Its TypesJoins And Its Types
Joins And Its Types
Wings Interactive
ย 
SQL
SQLSQL
Join query
Join queryJoin query
Join query
Waqar Ali
ย 
Excel SUMIFS Function
Excel SUMIFS FunctionExcel SUMIFS Function
Excel SUMIFS Function
Excel
ย 
Joins and unions
Joins and unionsJoins and unions
10 Excel Formulas that will help you in any Job
10 Excel Formulas that will help you in any Job10 Excel Formulas that will help you in any Job
10 Excel Formulas that will help you in any Job
Hitesh Biyani
ย 
Mastering Excel Formulas and Functions
Mastering Excel Formulas and FunctionsMastering Excel Formulas and Functions
Mastering Excel Formulas and Functions
LinkedIn Learning Solutions
ย 
Simple formulas excel
Simple formulas excelSimple formulas excel
Simple formulas excel
Malika khalil
ย 
Sql join
Sql  joinSql  join
Sql join
Vikas Gupta
ย 
Using formula and function
Using formula and functionUsing formula and function
Using formula and function
Rachel Espino
ย 
Cash flow using excel
Cash flow using excelCash flow using excel
Cash flow using excel
Malika khalil
ย 
Formula in MS Excel
Formula in MS ExcelFormula in MS Excel
Formula in MS Excel
Muhammad Yasir Bhutta
ย 
Ex13 lesson04
Ex13 lesson04Ex13 lesson04
Ex13 lesson04
sadejoseph
ย 
Oracle sql joins
Oracle sql joinsOracle sql joins
Oracle sql joins
redro
ย 
Office productivity tools
Office productivity toolsOffice productivity tools
Office productivity tools
Ullees Selim
ย 
Excel Chapter 2
Excel Chapter 2Excel Chapter 2
Excel Chapter 2
mindysholder
ย 

What's hot (20)

Spreadsheet new
Spreadsheet newSpreadsheet new
Spreadsheet new
ย 
SQL JOIN
SQL JOINSQL JOIN
SQL JOIN
ย 
Excel functions formulas
Excel functions formulasExcel functions formulas
Excel functions formulas
ย 
SQL JOINS- Reena P V
SQL JOINS- Reena P VSQL JOINS- Reena P V
SQL JOINS- Reena P V
ย 
Joins And Its Types
Joins And Its TypesJoins And Its Types
Joins And Its Types
ย 
SQL
SQLSQL
SQL
ย 
Join query
Join queryJoin query
Join query
ย 
Excel SUMIFS Function
Excel SUMIFS FunctionExcel SUMIFS Function
Excel SUMIFS Function
ย 
Joins and unions
Joins and unionsJoins and unions
Joins and unions
ย 
10 Excel Formulas that will help you in any Job
10 Excel Formulas that will help you in any Job10 Excel Formulas that will help you in any Job
10 Excel Formulas that will help you in any Job
ย 
Mastering Excel Formulas and Functions
Mastering Excel Formulas and FunctionsMastering Excel Formulas and Functions
Mastering Excel Formulas and Functions
ย 
Simple formulas excel
Simple formulas excelSimple formulas excel
Simple formulas excel
ย 
Sql join
Sql  joinSql  join
Sql join
ย 
Using formula and function
Using formula and functionUsing formula and function
Using formula and function
ย 
Cash flow using excel
Cash flow using excelCash flow using excel
Cash flow using excel
ย 
Formula in MS Excel
Formula in MS ExcelFormula in MS Excel
Formula in MS Excel
ย 
Ex13 lesson04
Ex13 lesson04Ex13 lesson04
Ex13 lesson04
ย 
Oracle sql joins
Oracle sql joinsOracle sql joins
Oracle sql joins
ย 
Office productivity tools
Office productivity toolsOffice productivity tools
Office productivity tools
ย 
Excel Chapter 2
Excel Chapter 2Excel Chapter 2
Excel Chapter 2
ย 

Viewers also liked

Date & time functions in VB.NET
Date & time functions in VB.NETDate & time functions in VB.NET
Date & time functions in VB.NET
A R
ย 
Screen Shots!
Screen Shots!Screen Shots!
Screen Shots!
guestb30178e7
ย 
Snapshot: Functional Excel Functions for E-Resources
Snapshot: Functional Excel Functions for E-ResourcesSnapshot: Functional Excel Functions for E-Resources
Snapshot: Functional Excel Functions for E-Resources
NASIG
ย 
Excel 2007 Unit E
Excel 2007 Unit EExcel 2007 Unit E
Excel 2007 Unit E
Raja Waseem Akhtar
ย 
Sumif In Excel
Sumif In ExcelSumif In Excel
Sumif In Excel
dinesh takyar
ย 
Ug recording excelmacros
Ug recording excelmacrosUg recording excelmacros
Ug recording excelmacros
Harry Adnan
ย 
Microsoft Office 2003 Creating Macros
Microsoft Office 2003 Creating MacrosMicrosoft Office 2003 Creating Macros
Microsoft Office 2003 Creating Macros
S Burks
ย 
MS-EXCEL Assignment Help
MS-EXCEL Assignment HelpMS-EXCEL Assignment Help
MS-EXCEL Assignment Help
Rahul Kataria
ย 
Intro macros in Excel 2007
Intro macros in Excel 2007Intro macros in Excel 2007
Intro macros in Excel 2007
Hasrudin Tazep
ย 
Vba Class Level 1
Vba Class Level 1Vba Class Level 1
Vba Class Level 1
Ben Miu CIMยฎ FCSI A+
ย 
Getting started with Microsoft Excel Macros
Getting started with Microsoft Excel MacrosGetting started with Microsoft Excel Macros
Getting started with Microsoft Excel Macros
Nick Weisenberger
ย 
Advanced Microsoft Excel
Advanced Microsoft ExcelAdvanced Microsoft Excel
Advanced Microsoft Excel
Eric Metelka
ย 
Excel Macro Magic
Excel Macro MagicExcel Macro Magic
Excel Macro Magic
Elaine Giles
ย 

Viewers also liked (13)

Date & time functions in VB.NET
Date & time functions in VB.NETDate & time functions in VB.NET
Date & time functions in VB.NET
ย 
Screen Shots!
Screen Shots!Screen Shots!
Screen Shots!
ย 
Snapshot: Functional Excel Functions for E-Resources
Snapshot: Functional Excel Functions for E-ResourcesSnapshot: Functional Excel Functions for E-Resources
Snapshot: Functional Excel Functions for E-Resources
ย 
Excel 2007 Unit E
Excel 2007 Unit EExcel 2007 Unit E
Excel 2007 Unit E
ย 
Sumif In Excel
Sumif In ExcelSumif In Excel
Sumif In Excel
ย 
Ug recording excelmacros
Ug recording excelmacrosUg recording excelmacros
Ug recording excelmacros
ย 
Microsoft Office 2003 Creating Macros
Microsoft Office 2003 Creating MacrosMicrosoft Office 2003 Creating Macros
Microsoft Office 2003 Creating Macros
ย 
MS-EXCEL Assignment Help
MS-EXCEL Assignment HelpMS-EXCEL Assignment Help
MS-EXCEL Assignment Help
ย 
Intro macros in Excel 2007
Intro macros in Excel 2007Intro macros in Excel 2007
Intro macros in Excel 2007
ย 
Vba Class Level 1
Vba Class Level 1Vba Class Level 1
Vba Class Level 1
ย 
Getting started with Microsoft Excel Macros
Getting started with Microsoft Excel MacrosGetting started with Microsoft Excel Macros
Getting started with Microsoft Excel Macros
ย 
Advanced Microsoft Excel
Advanced Microsoft ExcelAdvanced Microsoft Excel
Advanced Microsoft Excel
ย 
Excel Macro Magic
Excel Macro MagicExcel Macro Magic
Excel Macro Magic
ย 

Similar to If and nested i fs

ICDL Advanced Excel 2010 - Tutorial
ICDL Advanced Excel 2010 - TutorialICDL Advanced Excel 2010 - Tutorial
ICDL Advanced Excel 2010 - Tutorial
Michael Lew
ย 
Excel basics for everyday use-the more advanced stuff
Excel basics for everyday use-the more advanced stuffExcel basics for everyday use-the more advanced stuff
Excel basics for everyday use-the more advanced stuff
Kevin McLogan
ย 
Excel CH 02 Working with Formulas Functions.ppt
Excel CH 02 Working with Formulas Functions.pptExcel CH 02 Working with Formulas Functions.ppt
Excel CH 02 Working with Formulas Functions.ppt
EmmanuelOppongAfriyi1
ย 
03 Logical functions.pdf
03 Logical functions.pdf03 Logical functions.pdf
03 Logical functions.pdf
RizwanAli988729
ย 
Excel basics for everyday use part three
Excel basics for everyday use part threeExcel basics for everyday use part three
Excel basics for everyday use part three
Kevin McLogan
ย 
MA3696 Lecture 7
MA3696 Lecture 7MA3696 Lecture 7
MA3696 Lecture 7
Brunel University
ย 
Excel Formulas Functions 2007
Excel Formulas Functions 2007Excel Formulas Functions 2007
Excel Formulas Functions 2007
simply_coool
ย 
Excel Formulas Functions
Excel Formulas FunctionsExcel Formulas Functions
Excel Formulas Functions
simply_coool
ย 
Excel Top 10 formula For The Beginners
Excel Top 10 formula For The BeginnersExcel Top 10 formula For The Beginners
Excel Top 10 formula For The Beginners
Stat Analytica
ย 
Excel IF, IFs.ppt
Excel IF, IFs.pptExcel IF, IFs.ppt
Excel IF, IFs.ppt
EdwinAdeolaOluwasina1
ย 
Ms excel
Ms excelMs excel
Ms excel
HebaKidwai2
ย 
Introduction to excel - application to statistics
Introduction to excel - application to statisticsIntroduction to excel - application to statistics
Introduction to excel - application to statistics
zavenger
ย 
MS Excel 2010 tutorial 5
MS Excel 2010 tutorial 5MS Excel 2010 tutorial 5
MS Excel 2010 tutorial 5
Khalfan Alshuaili
ย 
Excle formula
Excle formulaExcle formula
Excle formula
Usman Khawaja
ย 
cse111-lecture10-1491556635.pptx
cse111-lecture10-1491556635.pptxcse111-lecture10-1491556635.pptx
cse111-lecture10-1491556635.pptx
ssuser3d8a50
ย 
Excell%20basic%20training(3) 143
Excell%20basic%20training(3) 143Excell%20basic%20training(3) 143
Excell%20basic%20training(3) 143
Ramesh Meti
ย 
Excel training
Excel trainingExcel training
Excel training
Alexandru Gologan
ย 
Empowerment Technologies - Module 5
Empowerment Technologies - Module 5Empowerment Technologies - Module 5
Empowerment Technologies - Module 5
Jesus Rances
ย 
Real World Excel Formulas
Real World Excel FormulasReal World Excel Formulas
Real World Excel Formulas
Michael Gowlett PMP, Prince 2 Practitioner
ย 
Excel
ExcelExcel
Excel
duttactg
ย 

Similar to If and nested i fs (20)

ICDL Advanced Excel 2010 - Tutorial
ICDL Advanced Excel 2010 - TutorialICDL Advanced Excel 2010 - Tutorial
ICDL Advanced Excel 2010 - Tutorial
ย 
Excel basics for everyday use-the more advanced stuff
Excel basics for everyday use-the more advanced stuffExcel basics for everyday use-the more advanced stuff
Excel basics for everyday use-the more advanced stuff
ย 
Excel CH 02 Working with Formulas Functions.ppt
Excel CH 02 Working with Formulas Functions.pptExcel CH 02 Working with Formulas Functions.ppt
Excel CH 02 Working with Formulas Functions.ppt
ย 
03 Logical functions.pdf
03 Logical functions.pdf03 Logical functions.pdf
03 Logical functions.pdf
ย 
Excel basics for everyday use part three
Excel basics for everyday use part threeExcel basics for everyday use part three
Excel basics for everyday use part three
ย 
MA3696 Lecture 7
MA3696 Lecture 7MA3696 Lecture 7
MA3696 Lecture 7
ย 
Excel Formulas Functions 2007
Excel Formulas Functions 2007Excel Formulas Functions 2007
Excel Formulas Functions 2007
ย 
Excel Formulas Functions
Excel Formulas FunctionsExcel Formulas Functions
Excel Formulas Functions
ย 
Excel Top 10 formula For The Beginners
Excel Top 10 formula For The BeginnersExcel Top 10 formula For The Beginners
Excel Top 10 formula For The Beginners
ย 
Excel IF, IFs.ppt
Excel IF, IFs.pptExcel IF, IFs.ppt
Excel IF, IFs.ppt
ย 
Ms excel
Ms excelMs excel
Ms excel
ย 
Introduction to excel - application to statistics
Introduction to excel - application to statisticsIntroduction to excel - application to statistics
Introduction to excel - application to statistics
ย 
MS Excel 2010 tutorial 5
MS Excel 2010 tutorial 5MS Excel 2010 tutorial 5
MS Excel 2010 tutorial 5
ย 
Excle formula
Excle formulaExcle formula
Excle formula
ย 
cse111-lecture10-1491556635.pptx
cse111-lecture10-1491556635.pptxcse111-lecture10-1491556635.pptx
cse111-lecture10-1491556635.pptx
ย 
Excell%20basic%20training(3) 143
Excell%20basic%20training(3) 143Excell%20basic%20training(3) 143
Excell%20basic%20training(3) 143
ย 
Excel training
Excel trainingExcel training
Excel training
ย 
Empowerment Technologies - Module 5
Empowerment Technologies - Module 5Empowerment Technologies - Module 5
Empowerment Technologies - Module 5
ย 
Real World Excel Formulas
Real World Excel FormulasReal World Excel Formulas
Real World Excel Formulas
ย 
Excel
ExcelExcel
Excel
ย 

Recently uploaded

NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
ย 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
ย 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
ย 
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
ImMuslim
ย 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
ย 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
nitinpv4ai
ย 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
National Information Standards Organization (NISO)
ย 
Nutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour TrainingNutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour Training
melliereed
ย 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
ย 
MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025
khuleseema60
ย 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
ย 
ู…ุตุญู ุงู„ู‚ุฑุงุกุงุช ุงู„ุนุดุฑ ุฃุนุฏ ุฃุญุฑู ุงู„ุฎู„ุงู ุณู…ูŠุฑ ุจุณูŠูˆู†ูŠ.pdf
ู…ุตุญู ุงู„ู‚ุฑุงุกุงุช ุงู„ุนุดุฑ   ุฃุนุฏ ุฃุญุฑู ุงู„ุฎู„ุงู ุณู…ูŠุฑ ุจุณูŠูˆู†ูŠ.pdfู…ุตุญู ุงู„ู‚ุฑุงุกุงุช ุงู„ุนุดุฑ   ุฃุนุฏ ุฃุญุฑู ุงู„ุฎู„ุงู ุณู…ูŠุฑ ุจุณูŠูˆู†ูŠ.pdf
ู…ุตุญู ุงู„ู‚ุฑุงุกุงุช ุงู„ุนุดุฑ ุฃุนุฏ ุฃุญุฑู ุงู„ุฎู„ุงู ุณู…ูŠุฑ ุจุณูŠูˆู†ูŠ.pdf
ุณู…ูŠุฑ ุจุณูŠูˆู†ูŠ
ย 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
ย 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
Iris Thiele Isip-Tan
ย 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
heathfieldcps1
ย 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
ย 
Prรฉsentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Prรฉsentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrรฉsentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Prรฉsentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
ย 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
ย 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
ย 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
MJDuyan
ย 

Recently uploaded (20)

NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
ย 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
ย 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
ย 
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
ย 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
ย 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
ย 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
ย 
Nutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour TrainingNutrition Inc FY 2024, 4 - Hour Training
Nutrition Inc FY 2024, 4 - Hour Training
ย 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
ย 
MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025
ย 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
ย 
ู…ุตุญู ุงู„ู‚ุฑุงุกุงุช ุงู„ุนุดุฑ ุฃุนุฏ ุฃุญุฑู ุงู„ุฎู„ุงู ุณู…ูŠุฑ ุจุณูŠูˆู†ูŠ.pdf
ู…ุตุญู ุงู„ู‚ุฑุงุกุงุช ุงู„ุนุดุฑ   ุฃุนุฏ ุฃุญุฑู ุงู„ุฎู„ุงู ุณู…ูŠุฑ ุจุณูŠูˆู†ูŠ.pdfู…ุตุญู ุงู„ู‚ุฑุงุกุงุช ุงู„ุนุดุฑ   ุฃุนุฏ ุฃุญุฑู ุงู„ุฎู„ุงู ุณู…ูŠุฑ ุจุณูŠูˆู†ูŠ.pdf
ู…ุตุญู ุงู„ู‚ุฑุงุกุงุช ุงู„ุนุดุฑ ุฃุนุฏ ุฃุญุฑู ุงู„ุฎู„ุงู ุณู…ูŠุฑ ุจุณูŠูˆู†ูŠ.pdf
ย 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
ย 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
ย 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
ย 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
ย 
Prรฉsentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Prรฉsentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrรฉsentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Prรฉsentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
ย 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
ย 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
ย 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
ย 

If and nested i fs

  • 1. If and Nested IFs @ntudigital BLOG blogs.ntu.ac.uk/digital_practice
  • 2. Getting to your session work files 1. Go to your laptopโ€™s desktop 2. Click the folder link to tdu-courses$ to open Open the Excel Courses > IF and NESTED IF folder Open the Excel IF formulas.xlsx file. Any of the files can be opened in a Read only condition. They can't be re-saved into this folder. If you want to keep them then save them to your H drive. You can also locate these files from your work computer: In a browser enter: opeltdu-courses$
  • 3. Logistics โ€ข Toilets โ€ข Drinks and Refreshments โ€ข Fire Alarms โ€ข Questions
  • 5. About the IF Function The IF function does something based on a decision โ€ข If this condition is TRUE do this thing โ€ข If it is FALSE then do a different thing Format: It is expressed in a formula =IF( Condition,Do this if true,Do this if false ) = IF ( ) ..,..,.. Equals means itโ€™s a formula with the IF function Brackets always come in pairs Must have commas to separate the 3 arguments Parts:
  • 6. Simple IF formulas =IF(A12=0, 35, 0) The value in this cell If FALSE In cell A10: evaluating numbers If TRUE
  • 7. Simple IF formulas =IF(A12<=D20, 35, 0) In cell A10: compare cell values arithmetically
  • 8. Simple IF formulas In cell A10: evaluating text =IF(A12 = โ€œPassโ€, โ€œPartyโ€, โ€œTry againโ€)
  • 9. Simple IF formulas In cell A10: cells can have empty or 0 as a result =IF(A12 = โ€œPassโ€, โ€œPartyโ€, โ€œโ€) =IF(A12 = โ€œPassโ€, โ€œPartyโ€, 0) Result if FALSE: Result if FALSE: (empty cell) (zero in cell)
  • 10. Exercise 1: IF exercises See workbook: Simple IF exercise Excel: Simple IFs tab
  • 11. Nested IFs โ€“ these notes are in your workbook โ€ข IFs are limited to 2 options โ€ข Nested IFs allow multiple options โ€ข They can be long formulas but their principles are the same: โ€ข There is only 1 equals sign โ€ข Each IF condition is tested for true from left to right โ€ข Use commas carefully โ€ข You must have an equal number of opening and closing brackets โ€ข Add no spaces between the parts of the formula โ€ข Formulas are not case sensitive โ€ข The formula tests for the 1st true result, then exits
  • 12. Nested IFs - format This is where the next condition goes =IF( , , ) IF( , , ))=IF( , , Note: โ€ข An equal number of open & closing brackets โ€ข There is only one equals sign True? True? True? False
  • 13. Nested IFs - format =IF(A12<50,โ€œFailโ€, ) This is where the next condition goes โ€“ after the comma =IF(A12>69,โ€œHigh passโ€, ) =IF(A12<50,โ€œFailโ€, IF(A12>69,โ€œHigh passโ€,โ€œPassโ€)) 2 IF conditions
  • 14. Nested IFs โ€“ repeating format = IF( , , IF( , , โ€ฆ IF( , , IF( , , โ€ฆ IF( , , IF( , , โ€ฆ IF( , , , ))))))) True? True? True? True? True? True? True? False
  • 15. Nested IFs โ€“ note the order of the evaluation =IF(A12>80,โ€œdistinction passโ€, โ€ฆ IF(A12>70,โ€œhigh passโ€, โ€ฆ IF(A12>60,โ€œgood passโ€, โ€ฆ IF(A12>=50,โ€œpassโ€, โ€ฆ โ€œfailโ€))))
  • 16. Exercises โ€“ Nested IF exercises See workbook: Nested IFs Exercises Excel: Nested IFs tab
  • 17. AND & OR nested IFs โ€“ for information only =IF(Cond1, is true, IF(cond2, is trueโ€ฆ,false)) The nested format we have used up to now is OR OR The nested format for AND =IF(Cond1,IF(Cond2,โ€both agreeโ€,โ€no agreementโ€)) AND โ€“ these notes are in your workbook
  • 18. SUMIF function โ€“ version 1 has 2 arguments =SUMIF(B1:B4,20) If a cell in the range satisfies the condition, then add it B 21 12 20 29 =SUMIF(B1:B4,โ€œ>20โ€) Result: 20 Result: 50 Note: If an argument contains text(<) it is enclosed in double quotes
  • 19. SUMIF function โ€“ version 2 has 3 arguments =SUMIF(A1:A4,โ€Redโ€,B1:B4) If a cell in the range satisfies the condition, then the values in a different column of the same row are added A B Red 21 Green 12 Blue 20 Red 29 Result: 50
  • 20. SUMIFS function โ€“ for multiple conditions =SUMIFS(B1:B4,A1:A4,โ€Redโ€,C1:C4,โ€OKโ€) Similar to SUMIF but allows agreement of multiple criteria. If ALL are true then add Sum-range cell content to total Result: 21 A B C Red 21 OK Green 12 Blue 20 OK Red 29 If TRUE If TRUESUM this &
  • 21. Exercises โ€“ SUMIF and SUMIFS exercises See workbook: SUMIF and SUMIFS exercises Excel: SUMIF and SUMIFS tabs
  • 22. COUNTIF functions โ€“ 2 arguments only =COUNTIF(B1:B4,20) If a cell in the range satisfies the condition, then count it B 21 12 20 29 =COUNTIF(B1:B4,โ€œ>20โ€) Result: 1 Result: 2 NOTE: Wildcard character searching: missing letters e.g. G**gle
  • 23. COUNTIFS function - multiple conditions =COUNTIFS(A1:A4,โ€œredโ€,C1:C4,โ€OKโ€) Similar to COUNTIF but allows for multiple criteria. If ALL are true then adds 1 to count total Result: 1 A B C Red 21 OK Green 12 Blue 20 OK Red 29
  • 24. Exercises โ€“ COUNTIF and COUNTIFS exercises See workbook: COUNTIF and COUNTIFS Excel: COUNTIF and COUNTIFS tabs
  • 25. Excel Training @NTU CPLD offers a series of Excel courses aimed to support your development โ€ข Spreadsheet Features (basic) โ€ข Conditional Formatting โ€ข Data Validation โ€ข Find & Replace โ€ข Pivot tables โ€ข Sorting and Filtering โ€ข Trimming, joining & selecting data โ€ข Creating visually effective spreadsheets *new โ€ข VLOOKUP For booking a place on these course or to arrange a 45 min 1 to 1 Surgery session go to the CPLD website: www.ntu.ac.uk/CPLD and look for the link to programme of events
  • 26. Office Central 08 June 2016 26 https://now.ntu.ac.uk/d2l/home/295527
  • 27. 08 June 2016 27 Office Surgeries http://ntu.ac.uk/apps/cpld/cpld_events/UI/events.aspx?&page=1&cat=2&kw=Office% 20Surgery