search
HomeTopicsexcelExcel data query INDEX and MATCH functions

This article brings you relevant knowledge about excel, mainly introducing the INDEX function and MATCH function. The combination of these two functions can complete all the search functions of the VLOOKUP function and HLOOKUP function. And it can realize queries in any direction and multi-condition queries, etc. I hope it will be helpful to everyone.

Excel data query INDEX and MATCH functions

Relevant learning recommendations: excel tutorial

Let’s first talk about the role of the INDEX function:

## The #INDEX function is used to return content based on the specified row and column numbers in a range.

This function usually uses two or three parameters. The three parameters are written as:

INDEX (cell range, specified number of rows, specified number of columns)

For example, the following formula is used to return the cell at the intersection of row 3 and column 4 of the A1:D4 cell range, that is, cell D3.

=INDEX(A1:D4,3,4)

Excel data query INDEX and MATCH functions

The two parameters are written as:

INDEX (a row or column of data, specify which element to return)

For example, the following formula is used to return the third element in the cell range A1:A4, that is, the content of cell A3.

=INDEX(A1:A4,3)

Excel data query INDEX and MATCH functions

Next let’s talk about the role of the MATCH function.

MATCH function is used to search for specified content in the query area of ​​a row or column, and then return the relative position of the content in the query area.

MATCH function has three parameters. The first parameter is the search object, the second parameter specifies the search range, and the third parameter is used to specify the matching method. Usually 0 is used to indicate an exact match.

Commonly used writing is:

MATCH (who you are looking for, the row or column area you want to query, the matching method)

For example, the following formula returns the content of cell C3 At the position in A2:A10, the result is 7.

MATCH(C3,A2:A10,0)

Note that the 7 here refers to the location of the search content in the query area, not the worksheet Which row of . In addition, if the data range contains multiple lookup values, the MATCH function will only return the first occurrence of the lookup value.

Excel data query INDEX and MATCH functions

Seeing this, some friends may have already figured it out. INDEX returns the content based on the position, and MATCH returns the position of the content in a row or column. Next, let’s talk about the common usage of these two partners:

Forward query

As shown in the figure below, based on the name in cell D3, query the corresponding query in columns A~B position.

The formula in cell E3 is:

=INDEX(B:B,MATCH(D3,A:A,0))

Excel data query INDEX and MATCH functions

First use the MATCH function to find the position of "Little Dragon Girl" in cell D3 in column A, and the result is 8. Then use the INDEX function to return the content of the 8th element in column B. The result is the position corresponding to Xiao Longnu.

Reverse query

As shown in the figure below, according to the position in cell D3, query the corresponding name in columns A~B.

The formula in cell E3 is:

=INDEX(A:A,MATCH(D3,B:B,0))

Excel data query INDEX and MATCH functions

First use the MATCH function to find the position of "Secretary" in cell D3 in column B, and the result is 5. Then use the INDEX function to return the content of the fifth element in column A. The result is the corresponding name of the secretary.

The formulas used for queries in two different directions are exactly the same. If you are interested, you can try how to write the search formula in the up and down directions.

Multi-condition query

In addition to conventional single-condition search, these two partners can also complete multi-condition queries.

As shown in the figure below, based on the position and age information in columns E and F, in the cell area of ​​columns A~C, search for the position corresponding to "Secretary" and the age "19" Name.

G3 cell formula is:

=INDEX(A:A,MATCH(E3&F3,B:B&C:C,0))

Note that this is an array formula. After the input is completed, you need to place the cursor in the edit box, hold down Shift ctrl, and then press Enter to complete.

Excel data query INDEX and MATCH functions

First use the connector & to merge the job ages of E3 and F3 into a new condition.

Use the connector to merge the information in columns B and C into a new query area.

Then use the MATCH function to query the position of position & age in the query area 8.

Finally use the INDEX function to obtain the content of the 8th element in column A, and finally complete the data query of the two conditions.

Related learning recommendations:

excel tutorial

The above is the detailed content of Excel data query INDEX and MATCH functions. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:Excel Home. If there is any infringement, please contact admin@php.cn delete
MEDIAN formula in Excel - practical examplesMEDIAN formula in Excel - practical examplesApr 11, 2025 pm 12:08 PM

This tutorial explains how to calculate the median of numerical data in Excel using the MEDIAN function. The median, a key measure of central tendency, identifies the middle value in a dataset, offering a more robust representation of central tenden

Google Spreadsheet COUNTIF function with formula examplesGoogle Spreadsheet COUNTIF function with formula examplesApr 11, 2025 pm 12:03 PM

Master Google Sheets COUNTIF: A Comprehensive Guide This guide explores the versatile COUNTIF function in Google Sheets, demonstrating its applications beyond simple cell counting. We'll cover various scenarios, from exact and partial matches to han

Excel shared workbook: How to share Excel file for multiple usersExcel shared workbook: How to share Excel file for multiple usersApr 11, 2025 am 11:58 AM

This tutorial provides a comprehensive guide to sharing Excel workbooks, covering various methods, access control, and conflict resolution. Modern Excel versions (2010, 2013, 2016, and later) simplify collaborative editing, eliminating the need to m

How to convert Excel to JPG - save .xls or .xlsx as image fileHow to convert Excel to JPG - save .xls or .xlsx as image fileApr 11, 2025 am 11:31 AM

This tutorial explores various methods for converting .xls files to .jpg images, encompassing both built-in Windows tools and free online converters. Need to create a presentation, share spreadsheet data securely, or design a document? Converting yo

Excel names and named ranges: how to define and use in formulasExcel names and named ranges: how to define and use in formulasApr 11, 2025 am 11:13 AM

This tutorial clarifies the function of Excel names and demonstrates how to define names for cells, ranges, constants, or formulas. It also covers editing, filtering, and deleting defined names. Excel names, while incredibly useful, are often overlo

Standard deviation Excel: functions and formula examplesStandard deviation Excel: functions and formula examplesApr 11, 2025 am 11:01 AM

This tutorial clarifies the distinction between standard deviation and standard error of the mean, guiding you on the optimal Excel functions for standard deviation calculations. In descriptive statistics, the mean and standard deviation are intrinsi

Square root in Excel: SQRT function and other waysSquare root in Excel: SQRT function and other waysApr 11, 2025 am 10:34 AM

This Excel tutorial demonstrates how to calculate square roots and nth roots. Finding the square root is a common mathematical operation, and Excel offers several methods. Methods for Calculating Square Roots in Excel: Using the SQRT Function: The

Google Sheets basics: Learn how to work with Google SpreadsheetsGoogle Sheets basics: Learn how to work with Google SpreadsheetsApr 11, 2025 am 10:23 AM

Unlock the Power of Google Sheets: A Beginner's Guide This tutorial introduces the fundamentals of Google Sheets, a powerful and versatile alternative to MS Excel. Learn how to effortlessly manage spreadsheets, leverage key features, and collaborate

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor