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

PDF
Spreadsheet text functions
PPTX
Vlookup - an introduction
PDF
Excel Tutorials - VLOOKUP and HLOOKUP Functions
PPTX
Training presentation vlookup - what it is, and when to use it
PDF
3. lookup functions in excel
PDF
Spreadsheet Date & Time Functions
PPT
Sql operators & functions 3
PDF
Row, Column, Index, Match, Offset Functions. Excel Tutorial
Spreadsheet text functions
Vlookup - an introduction
Excel Tutorials - VLOOKUP and HLOOKUP Functions
Training presentation vlookup - what it is, and when to use it
3. lookup functions in excel
Spreadsheet Date & Time Functions
Sql operators & functions 3
Row, Column, Index, Match, Offset Functions. Excel Tutorial

What's hot (20)

PPTX
MS-EXCEL Assignment Help
PPTX
Sorting and Filtering.pptx
PPT
Using vlookup in excel
PPTX
Intermediate Excel
PPT
Excel IF, IFs.ppt
PPTX
Pivot table and Dashboard in microsoft excel
PPTX
Excel Function Training
PDF
Excel functions formulas
PPTX
VLOOKUP HLOOKUP INDEX MATCH
PPTX
Microsoft Excel Tutorial
PPT
Microsoft Excel VLOOKUP Function
 
PPTX
Joins And Its Types
PPT
Look up functions
PDF
Formulas and functions - By Amresh Tiwari
PPT
Join sql
PPTX
Presentation slides of Sequence Query Language (SQL)
PPTX
SQL - DML and DDL Commands
PDF
Tuples in Python
PPTX
Sql joins inner join self join outer joins
MS-EXCEL Assignment Help
Sorting and Filtering.pptx
Using vlookup in excel
Intermediate Excel
Excel IF, IFs.ppt
Pivot table and Dashboard in microsoft excel
Excel Function Training
Excel functions formulas
VLOOKUP HLOOKUP INDEX MATCH
Microsoft Excel Tutorial
Microsoft Excel VLOOKUP Function
 
Joins And Its Types
Look up functions
Formulas and functions - By Amresh Tiwari
Join sql
Presentation slides of Sequence Query Language (SQL)
SQL - DML and DDL Commands
Tuples in Python
Sql joins inner join self join outer joins
Ad

Similar to MS excel - match function (20)

PPTX
Using Excel Functions
PPTX
Excel Overview.pptx
PPTX
it skill excel sheet for ppt.pptx
PPTX
MIS 226: Chapter 2
PPTX
Advanced Excel, Day 1
PDF
Excel formulas-manual
PPTX
the various Excel Functions in powerpoint format.pptx
PPTX
PPTX
Useful Excel Functions & Formula Used everywhere.pptx
DOC
Excel tips
PPT
Get more from excel
PPTX
Mastering Excel Formulas and Functions
PPTX
Training excel
PPTX
Tableau is a data visualization tool that lets us analyze virtually any type ...
PPTX
Analytics on Spreadsheets-converted.pptx
DOCX
Excel formulas
PDF
Excel.useful fns
PDF
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
DOCX
Exploring Microsoft Office 2010 Volume 1 Excel Chapter 2Testbank.docx
 
PPTX
introduction to supply chain management for excel
Using Excel Functions
Excel Overview.pptx
it skill excel sheet for ppt.pptx
MIS 226: Chapter 2
Advanced Excel, Day 1
Excel formulas-manual
the various Excel Functions in powerpoint format.pptx
Useful Excel Functions & Formula Used everywhere.pptx
Excel tips
Get more from excel
Mastering Excel Formulas and Functions
Training excel
Tableau is a data visualization tool that lets us analyze virtually any type ...
Analytics on Spreadsheets-converted.pptx
Excel formulas
Excel.useful fns
On if,countif,countifs,sumif,countifs,lookup,v lookup,index,match
Exploring Microsoft Office 2010 Volume 1 Excel Chapter 2Testbank.docx
 
introduction to supply chain management for excel
Ad

Recently uploaded (20)

PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PPTX
Computer Architecture Input Output Memory.pptx
PDF
Environmental Education MCQ BD2EE - Share Source.pdf
PPTX
What’s under the hood: Parsing standardized learning content for AI
PDF
Mucosal Drug Delivery system_NDDS_BPHARMACY__SEM VII_PCI.pdf
PPTX
Module on health assessment of CHN. pptx
PDF
Complications of Minimal Access-Surgery.pdf
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
HVAC Specification 2024 according to central public works department
PDF
Race Reva University – Shaping Future Leaders in Artificial Intelligence
PDF
My India Quiz Book_20210205121199924.pdf
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
semiconductor packaging in vlsi design fab
PPTX
Core Concepts of Personalized Learning and Virtual Learning Environments
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
A powerpoint presentation on the Revised K-10 Science Shaping Paper
Computer Architecture Input Output Memory.pptx
Environmental Education MCQ BD2EE - Share Source.pdf
What’s under the hood: Parsing standardized learning content for AI
Mucosal Drug Delivery system_NDDS_BPHARMACY__SEM VII_PCI.pdf
Module on health assessment of CHN. pptx
Complications of Minimal Access-Surgery.pdf
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
Share_Module_2_Power_conflict_and_negotiation.pptx
HVAC Specification 2024 according to central public works department
Race Reva University – Shaping Future Leaders in Artificial Intelligence
My India Quiz Book_20210205121199924.pdf
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
Cambridge-Practice-Tests-for-IELTS-12.docx
What if we spent less time fighting change, and more time building what’s rig...
semiconductor packaging in vlsi design fab
Core Concepts of Personalized Learning and Virtual Learning Environments
B.Sc. DS Unit 2 Software Engineering.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.