Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • Remove Duplicates Example in Excel
  • Conflicting Multiple Conditional Formatting Rules in Excel
  • Subtotal function in Excel
  • How To Load Analysis ToolPak in Excel
  • How to Create Column Chart in Excel

References

  • Count rows with at least n matching values
  • Vlookup Examples in Excel
  • How to get last row in numeric data in Excel
  • Convert text string to valid reference in Excel using Indirect function
  • Multi-criteria lookup and transpose in Excel

Data Validations

  • Excel Data validation with conditional list
  • Excel Data validation allow weekday only
  • Excel Data validation whole percentage only
  • Data validation must not exist in list
  • Excel Data validation must not contain

Join tables with INDEX and MATCH in Excel

by

This tutorial shows how to Join tables with INDEX and MATCH in Excel using the example below;

Formula

=INDEX(data,MATCH(lookup,ids,0),2)

Explanation

To join or merge tables that have a common id, you can use the INDEX and MATCH functions. In the example shown, the formula in E5 is:

=INDEX(data,MATCH($C5,ids,0),2)

where “data” is the named range H5:J8 and “ids” is the named range H5:H8.

How this formula works

This formula pulls the customer name and state from the customer table into the order table. The MATCH function is used to locate the right customer and the INDEX function is used to retrieve the data.

Retrieving customer name

Working from the inside out, the MATCH function is used to get a row number like this:

MATCH($C5,ids,0)
  • The lookup value comes the customer id in C5, which is a mixed reference, with the column locked, so the formula can be easily copied.
  • The lookup array is the named range ids (H5:H8), the first column in the customer table.
  • The match type is set to zero to force an exact match.

The MATCH function returns 2 in this case, which goes into INDEX as the row number:

=INDEX(data,2,2)

With the column number hard-coded as 2 (customer names are in column 2) and the array set to the named range “data” (H5:J8) INDEX returns: Amy Chang.

Retrieving customer state

The formula to retrieve customer state is almost identical. The only difference is the column number is hard-coded as 3, since state info appears in the 3rd column:

=INDEX(data,MATCH($C5,ids,0),2) // get name
=INDEX(data,MATCH($C5,ids,0),3) // get state

Dynamic two-way match

By adding another MATCH function to the formula, you can set up a dynamic two-way match. For example, with the named range “headers” for  H4:J4, you can use a formula like this:

=INDEX(data,MATCH($C5,ids,0),MATCH(E$4,headers,0))

Here, a second MATCH function has been added to get the correct column number. MATCH uses the current column header in the first table to locate the correct column number in the second table, and automatically returns this number to INDEX.

Post navigation

Previous Post:

COSH function: Description, Usage, Syntax, Examples and Explanation

Next Post:

Excel Data validation require unique number

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • AND function: Description, Usage, Syntax, Examples and Explanation
  • IF function: Description, Usage, Syntax, Examples and Explanation
  • Invoice status with nested if in Excel
  • IFNA function: Description, Usage, Syntax, Examples and Explanation
  • IFERROR function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • DATE function: Description, Usage, Syntax, Examples and Explanation
  • TIME function: Description, Usage, Syntax, Examples and Explanation
  • WORKDAY.INTL function: Description, Usage, Syntax, Examples and Explanation
  • How to get same date next month or previous month in Excel
  • Get days before a date in Excel

Grouping

  • Map inputs to arbitrary values in Excel
  • Running count group by n size in Excel
  • Map text to numbers in Excel
  • How to randomly assign people to groups in Excel
  • Group times into unequal buckets in Excel

General

  • How to get original number from percent change in Excel
  • Currency vs Accounting Format in Excel
  • With vs Without Array Formula in Excel
  • How to count total columns in range in Excel
  • Convert column letter to number in Excel
© 2026 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning