SlideShare a Scribd company logo
1 of 14
CHAPTER 4
MATCH function
Questions answered in this chapter:
• Given monthly sales for several products [Productlookup.xlsx], how
can I write a formula that returns the sales of a product during a
specific month? For example, how much of Product 2 did I sell
during June?
• Given a list of baseball players’ salaries [Baseball.xlsx], how can I
write a formula that yields the player with the highest salary? How
about the player with the fifth-highest salary?
• Given the annual cash flows [Payback.xlsx] from an investment
project, how do I write a formula that returns the number of years
required to pay back the project’s initial investment cost?
Suppose you have a worksheet with 5,000 rows containing 5,000
names. You need to find the name John Doe, which you know
appears somewhere (and only once) in the list. Wouldn’t you
like to know of a formula that would return the row number that
contains that name? The MATCH function enables you to find
the first occurrence of a match to a given text string or number
within a given array. You should use the MATCH function
instead of a lookup function when you want the position of a
number in a range rather than the value in a particular cell.
The syntax of the match function is:
Match(lookup value, lookup range,[match type])
In the explanation that follows, assume that all cells in the
lookup range are in the same column.
In this syntax:
• Lookup value is the value you’re trying to match in the lookup
range.
• Lookup range is the range you’re examining for a match to the
lookup value. The lookup range must be a row or column.
Match type=1 requires the lookup range to
consist of numbers listed in ascending
order.
The MATCH function then returns the row
location in the lookup range (relative to the
top of the lookup range) that contains the
largest value in the range that is less than
or equal to the lookup value.
Match type=–1 requires the lookup range to
consist of numbers listed in descending order.
The MATCH function returns the row location
in the lookup range (relative to the top of the
lookup range) that contains the last value in the
range that is greater than or equal to the lookup
value.
• Match type=0 returns the row location in the lookup
range that contains the first exact match to the lookup
value. When no exact match exists and match type=0,
Excel returns the error message #N/A.
• Most MATCH function applications use match
type=0, but if match type is not included, match
type=1 is assumed. Thus, use match type=0 when the
cell contents of the lookup range are unsorted. This is
the situation you usually face.
The Matchex.xlsx file, shown in Figure 4-1, contains three
examples of the MATCH function’s syntax.
• In cell B13, the MATCH(“Boston”,B4:B11,0) formula returns
1 because the first row in the B4:B11 range contains the value
Boston. Text values must be enclosed in quotation marks (“”).
In cell B14, the MATCH(“Phoenix”,B4:B11,0) formula returns
7 because cell B10 (the seventh cell in B4:B11) is the first cell
in the range that matches Phoenix. In cell E12, the
MATCH(0,E4:E11,1) formula returns 4 because the last
number that is less than or equal to 0 in the E4:E11 range is in
cell E7 (the fourth cell in the lookup range). In cell G12, the
MATCH(–4,G4:G11,–1) formula returns 7 because the last
number that is greater than or equal to –4 in the G4:G11 range
is contained in cell G10 (the seventh cell in the lookup range).
• The MATCH function can also work with an
inexact match. For example, the
MATCH(“Pho*”,B4:B11,0) formula returns
7. The asterisk is treated as a wildcard, which
means that Microsoft Excel searches for the
first text string in the B4:B11 range that begins
with Pho. Incidentally, this same technique can
be used with a lookup function.
• If the lookup range is contained in a single row,
Excel returns the relative position of the first
match in the lookup range, moving from left to
right. As shown in the following examples, the
MATCH function is often very useful when it
is combined with other Excel functions such as
VLOOKUP, INDEX, or MAX.
You should solve this
1. Using the distances between US cities given in the
Index.xlsx file, write a formula using the MATCH function
to determine (based on the names of the cities) the distance
between any two of the cities.
2. The Matchtype1.xlsx file lists the dollar amounts of 30
transactions in chronological order. Write a formula that
yields the first transaction for which total volume to date
exceeds P10,000.
You should solve this
3. The Matchthemax.xlsx file gives the product ID codes
and unit sales for 265 products. Use the MATCH function
in a formula that yields the product ID code of the product
with the largest unit sales.
4. The Buslist.xlsx file gives the amount of time between
bus arrivals (in minutes) at 45th Street and Park Avenue in
New York City. Write a formula that, for any arrival time
after the first bus, gives the amount of time you have to
wait for a bus. For example, if you arrive 12.4 minutes
from now, and buses arrive 5 minutes and 21 minutes from
now, you wait 21 – 12.4 = 8.6 minutes for a bus.

More Related Content

What's hot

VLOOKUP HLOOKUP INDEX MATCH
VLOOKUP HLOOKUP INDEX MATCHVLOOKUP HLOOKUP INDEX MATCH
VLOOKUP HLOOKUP INDEX MATCHMridul Bansal
 
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,matchOn if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,matchRakesh Sah
 
1. statistical functions in excel
1. statistical functions in excel1. statistical functions in excel
1. statistical functions in excelDr. Prashant Vats
 
How to use Hlookup find an exact match
How to use Hlookup find an exact match How to use Hlookup find an exact match
How to use Hlookup find an exact match Excel Advise
 
VISUAL BASIC 6 - CONTROLS AND DECLARATIONS
VISUAL BASIC 6 - CONTROLS AND DECLARATIONSVISUAL BASIC 6 - CONTROLS AND DECLARATIONS
VISUAL BASIC 6 - CONTROLS AND DECLARATIONSSuraj Kumar
 
How to use vlookup in MS Excel
How to use vlookup in MS ExcelHow to use vlookup in MS Excel
How to use vlookup in MS ExcelJaspal Singh
 
Advanced Filter in Excel
Advanced Filter in ExcelAdvanced Filter in Excel
Advanced Filter in Exceldinesh takyar
 
Excel functions formulas
Excel functions formulasExcel functions formulas
Excel functions formulasLearnIT@UD
 
VERSIONS AND FUNCTIONS OF MS EXCEL
VERSIONS AND FUNCTIONS OF MS EXCELVERSIONS AND FUNCTIONS OF MS EXCEL
VERSIONS AND FUNCTIONS OF MS EXCELIMRAN WASTA
 
MS-Excel Formulas and Functions
MS-Excel Formulas and FunctionsMS-Excel Formulas and Functions
MS-Excel Formulas and FunctionsP. SUNDARI ARUN
 
Excel functions and formulas
Excel functions and formulasExcel functions and formulas
Excel functions and formulasJason Wong
 

What's hot (20)

VLOOKUP HLOOKUP INDEX MATCH
VLOOKUP HLOOKUP INDEX MATCHVLOOKUP HLOOKUP INDEX MATCH
VLOOKUP HLOOKUP INDEX MATCH
 
USING VLOOKUP FUNCTION
USING VLOOKUP FUNCTIONUSING VLOOKUP FUNCTION
USING VLOOKUP FUNCTION
 
Excel text function
Excel text functionExcel text function
Excel text function
 
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,matchOn if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
 
1. statistical functions in excel
1. statistical functions in excel1. statistical functions in excel
1. statistical functions in excel
 
How to use Hlookup find an exact match
How to use Hlookup find an exact match How to use Hlookup find an exact match
How to use Hlookup find an exact match
 
Sumif () ppt
Sumif () pptSumif () ppt
Sumif () ppt
 
Look up functions
Look up functionsLook up functions
Look up functions
 
VISUAL BASIC 6 - CONTROLS AND DECLARATIONS
VISUAL BASIC 6 - CONTROLS AND DECLARATIONSVISUAL BASIC 6 - CONTROLS AND DECLARATIONS
VISUAL BASIC 6 - CONTROLS AND DECLARATIONS
 
Ppt on pivot table
Ppt on pivot tablePpt on pivot table
Ppt on pivot table
 
Ms excel
Ms excelMs excel
Ms excel
 
How to use vlookup in MS Excel
How to use vlookup in MS ExcelHow to use vlookup in MS Excel
How to use vlookup in MS Excel
 
Advanced Filter in Excel
Advanced Filter in ExcelAdvanced Filter in Excel
Advanced Filter in Excel
 
Excel functions formulas
Excel functions formulasExcel functions formulas
Excel functions formulas
 
VERSIONS AND FUNCTIONS OF MS EXCEL
VERSIONS AND FUNCTIONS OF MS EXCELVERSIONS AND FUNCTIONS OF MS EXCEL
VERSIONS AND FUNCTIONS OF MS EXCEL
 
MS-Excel Formulas and Functions
MS-Excel Formulas and FunctionsMS-Excel Formulas and Functions
MS-Excel Formulas and Functions
 
MS Excel Training 01
MS Excel Training 01MS Excel Training 01
MS Excel Training 01
 
Excel Pivot Tables
Excel Pivot TablesExcel Pivot Tables
Excel Pivot Tables
 
Ms excel
Ms excelMs excel
Ms excel
 
Excel functions and formulas
Excel functions and formulasExcel functions and formulas
Excel functions and formulas
 

Similar to MS excel - match function

Excel formulas-manual
Excel formulas-manualExcel formulas-manual
Excel formulas-manualjpdas54
 
3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.ppt3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.pptAllanGuevarra1
 
Commonly used excel formulas
Commonly used excel formulasCommonly used excel formulas
Commonly used excel formulassaladi330
 
Commonly used excel formulas
Commonly used excel formulasCommonly used excel formulas
Commonly used excel formulassaladi330
 
3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.ppt3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.pptJosephIThomas
 
Introduction_Excel.ppt
Introduction_Excel.pptIntroduction_Excel.ppt
Introduction_Excel.pptelsagalgao
 
Intro to Excel Basics: Part I
Intro to Excel Basics: Part IIntro to Excel Basics: Part I
Intro to Excel Basics: Part ISi Krishan
 
Excel advanced formulas and functions i-school tutorials
Excel  advanced formulas and functions   i-school tutorialsExcel  advanced formulas and functions   i-school tutorials
Excel advanced formulas and functions i-school tutorialstechie_govind
 
Excel Overview.pptx
Excel Overview.pptxExcel Overview.pptx
Excel Overview.pptxNewmanLeke
 
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 BeginnersStat Analytica
 
Week 5_Lesson_Working with formulas and Functions.pptx
Week 5_Lesson_Working with formulas and Functions.pptxWeek 5_Lesson_Working with formulas and Functions.pptx
Week 5_Lesson_Working with formulas and Functions.pptxMelvyEspanol1
 
Introduction to micro soft Training ms Excel.ppt
Introduction to micro soft Training ms Excel.pptIntroduction to micro soft Training ms Excel.ppt
Introduction to micro soft Training ms Excel.pptdejene3
 
Dervy bis 155 week 1 quiz new
Dervy   bis 155 week 1 quiz newDervy   bis 155 week 1 quiz new
Dervy bis 155 week 1 quiz newkxipvscsk02
 
Excel Formulas Functions
Excel Formulas FunctionsExcel Formulas Functions
Excel Formulas Functionssimply_coool
 
Excel Formulas Functions 2007
Excel Formulas Functions 2007Excel Formulas Functions 2007
Excel Formulas Functions 2007simply_coool
 

Similar to MS excel - match function (20)

Ms excel
Ms excelMs excel
Ms excel
 
Excel formulas-manual
Excel formulas-manualExcel formulas-manual
Excel formulas-manual
 
3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.ppt3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.ppt
 
Commonly used excel formulas
Commonly used excel formulasCommonly used excel formulas
Commonly used excel formulas
 
Commonly used excel formulas
Commonly used excel formulasCommonly used excel formulas
Commonly used excel formulas
 
3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.ppt3 Formulas, Ranges, Functions.ppt
3 Formulas, Ranges, Functions.ppt
 
Introduction_Excel.ppt
Introduction_Excel.pptIntroduction_Excel.ppt
Introduction_Excel.ppt
 
Introduction_Excel.ppt
Introduction_Excel.pptIntroduction_Excel.ppt
Introduction_Excel.ppt
 
Introduction_Excel.ppt
Introduction_Excel.pptIntroduction_Excel.ppt
Introduction_Excel.ppt
 
Introduction_Excel.ppt
Introduction_Excel.pptIntroduction_Excel.ppt
Introduction_Excel.ppt
 
Intro to Excel Basics: Part I
Intro to Excel Basics: Part IIntro to Excel Basics: Part I
Intro to Excel Basics: Part I
 
Excel advanced formulas and functions i-school tutorials
Excel  advanced formulas and functions   i-school tutorialsExcel  advanced formulas and functions   i-school tutorials
Excel advanced formulas and functions i-school tutorials
 
Excel Overview.pptx
Excel Overview.pptxExcel Overview.pptx
Excel Overview.pptx
 
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.useful fns
Excel.useful fnsExcel.useful fns
Excel.useful fns
 
Week 5_Lesson_Working with formulas and Functions.pptx
Week 5_Lesson_Working with formulas and Functions.pptxWeek 5_Lesson_Working with formulas and Functions.pptx
Week 5_Lesson_Working with formulas and Functions.pptx
 
Introduction to micro soft Training ms Excel.ppt
Introduction to micro soft Training ms Excel.pptIntroduction to micro soft Training ms Excel.ppt
Introduction to micro soft Training ms Excel.ppt
 
Dervy bis 155 week 1 quiz new
Dervy   bis 155 week 1 quiz newDervy   bis 155 week 1 quiz new
Dervy bis 155 week 1 quiz new
 
Excel Formulas Functions
Excel Formulas FunctionsExcel Formulas Functions
Excel Formulas Functions
 
Excel Formulas Functions 2007
Excel Formulas Functions 2007Excel Formulas Functions 2007
Excel Formulas Functions 2007
 

Recently uploaded

Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 

Recently uploaded (20)

OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 

MS excel - match function

  • 2. Questions answered in this chapter: • Given monthly sales for several products [Productlookup.xlsx], how can I write a formula that returns the sales of a product during a specific month? For example, how much of Product 2 did I sell during June? • Given a list of baseball players’ salaries [Baseball.xlsx], how can I write a formula that yields the player with the highest salary? How about the player with the fifth-highest salary? • Given the annual cash flows [Payback.xlsx] from an investment project, how do I write a formula that returns the number of years required to pay back the project’s initial investment cost?
  • 3. Suppose you have a worksheet with 5,000 rows containing 5,000 names. You need to find the name John Doe, which you know appears somewhere (and only once) in the list. Wouldn’t you like to know of a formula that would return the row number that contains that name? The MATCH function enables you to find the first occurrence of a match to a given text string or number within a given array. You should use the MATCH function instead of a lookup function when you want the position of a number in a range rather than the value in a particular cell.
  • 4. The syntax of the match function is: Match(lookup value, lookup range,[match type])
  • 5. In the explanation that follows, assume that all cells in the lookup range are in the same column. In this syntax: • Lookup value is the value you’re trying to match in the lookup range. • Lookup range is the range you’re examining for a match to the lookup value. The lookup range must be a row or column.
  • 6. Match type=1 requires the lookup range to consist of numbers listed in ascending order. The MATCH function then returns the row location in the lookup range (relative to the top of the lookup range) that contains the largest value in the range that is less than or equal to the lookup value.
  • 7. Match type=–1 requires the lookup range to consist of numbers listed in descending order. The MATCH function returns the row location in the lookup range (relative to the top of the lookup range) that contains the last value in the range that is greater than or equal to the lookup value.
  • 8. • Match type=0 returns the row location in the lookup range that contains the first exact match to the lookup value. When no exact match exists and match type=0, Excel returns the error message #N/A. • Most MATCH function applications use match type=0, but if match type is not included, match type=1 is assumed. Thus, use match type=0 when the cell contents of the lookup range are unsorted. This is the situation you usually face.
  • 9. The Matchex.xlsx file, shown in Figure 4-1, contains three examples of the MATCH function’s syntax.
  • 10. • In cell B13, the MATCH(“Boston”,B4:B11,0) formula returns 1 because the first row in the B4:B11 range contains the value Boston. Text values must be enclosed in quotation marks (“”). In cell B14, the MATCH(“Phoenix”,B4:B11,0) formula returns 7 because cell B10 (the seventh cell in B4:B11) is the first cell in the range that matches Phoenix. In cell E12, the MATCH(0,E4:E11,1) formula returns 4 because the last number that is less than or equal to 0 in the E4:E11 range is in cell E7 (the fourth cell in the lookup range). In cell G12, the MATCH(–4,G4:G11,–1) formula returns 7 because the last number that is greater than or equal to –4 in the G4:G11 range is contained in cell G10 (the seventh cell in the lookup range).
  • 11. • The MATCH function can also work with an inexact match. For example, the MATCH(“Pho*”,B4:B11,0) formula returns 7. The asterisk is treated as a wildcard, which means that Microsoft Excel searches for the first text string in the B4:B11 range that begins with Pho. Incidentally, this same technique can be used with a lookup function.
  • 12. • If the lookup range is contained in a single row, Excel returns the relative position of the first match in the lookup range, moving from left to right. As shown in the following examples, the MATCH function is often very useful when it is combined with other Excel functions such as VLOOKUP, INDEX, or MAX.
  • 13. You should solve this 1. Using the distances between US cities given in the Index.xlsx file, write a formula using the MATCH function to determine (based on the names of the cities) the distance between any two of the cities. 2. The Matchtype1.xlsx file lists the dollar amounts of 30 transactions in chronological order. Write a formula that yields the first transaction for which total volume to date exceeds P10,000.
  • 14. You should solve this 3. The Matchthemax.xlsx file gives the product ID codes and unit sales for 265 products. Use the MATCH function in a formula that yields the product ID code of the product with the largest unit sales. 4. The Buslist.xlsx file gives the amount of time between bus arrivals (in minutes) at 45th Street and Park Avenue in New York City. Write a formula that, for any arrival time after the first bus, gives the amount of time you have to wait for a bus. For example, if you arrive 12.4 minutes from now, and buses arrive 5 minutes and 21 minutes from now, you wait 21 – 12.4 = 8.6 minutes for a bus.