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

Data Analysis

  • Conditional Formatting Rules in Excel
  • Calculate Conditional Percentile ‘IF’ in table in Excel
  • What-If Analysis: Scenarios and Goal Seek in Excel
  • How to Use Solver Tool in Excel
  • Use Data Form to input, edit and delete records in Excel

References

  • How to get last column number in range in Excel
  • Two-way lookup with VLOOKUP in Excel
  • How to use Excel TRANSPOSE Function
  • How to use Excel ROW Function
  • Excel Advanced Lookup using Index and Match Functions

Data Validations

  • Excel Data validation must contain specific text
  • Excel Data validation date in next 30 days
  • How To Create Drop-down List in Excel
  • Excel Data validation allow uppercase only
  • Excel Data validation allow weekday only

Index and match on multiple columns in Excel

by

This tutorial shows how to calculate Index and match on multiple columns in Excel  using the example below;

Formula

{=INDEX(range1,MATCH(1,MMULT(--(range2=critera),
TRANSPOSE(COLUMN(range2)^0)),0))}

Explanation

To lookup a value by matching across multiple columns, you can use an array formula based on the MMULT, TRANSPOSE, COLUMN, and INDEX. In the example shown, the formula in H4 is:

{=INDEX(groups,MATCH(1,MMULT(--(names=G4),
TRANSPOSE(COLUMN(names)^0)),0))}

where “names” is the named range C4:E7, and “groups” is the named range B4:B7. The formula returns the group that each name belongs to.

Note: this is an array formula and must be entered with control shift enter.

How this formula works

Working from the inside out, the logical criteria used in this formula is:

--(names=G4)

where names is the named range C4:E7. This generates a TRUE / FALSE result for every value in data, and the double negative coerces the TRUE FALSE values to 1 and 0 to yield an array like this:

{0,0,0;1,0,0;0,0,0;0,0,0}

This array is 4 rows by 3 columns, matching the structure of “names”.

A second array is created with this expression:

TRANSPOSE(COLUMN(names)^0))

The COLUMN function is used to create a numeric array with 3 columns and 1 row, and TRANSPOSE converts this array to 1 column and 3 rows. Raising to the power of zero simply converts all numbers in the array to 1. The MMULT function is then used to perform matrix multiplication:

MMULT({0,0,0;1,0,0;0,0,0;0,0,0},{1;1;1})

and the resulting goes into the MATCH function as the array, with 1 as the lookup value:

MATCH(1,{0;1;0;0},0)

The MATCH function returns the position of the first match, which corresponds to the row of the first matching row meeting supplied criteria. This is feed into INDEX as the row number, with the named range “groups” as the array:

=INDEX(groups,2)

Finally, INDEX returns “Bear”, the group Adam belongs to.

Literal contains for criteria

To check for specific text values instead of an exact match, you can use the ISNUMBER and SEARCH functions together. For example, to match cells that contain “apple” you can use:

=ISNUMBER(SEARCH("apple",data))

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

  • IFERROR function: Description, Usage, Syntax, Examples and Explanation
  • OR function Examples in Excel
  • AND function: Description, Usage, Syntax, Examples and Explanation
  • IFS function: Description, Usage, Syntax, Examples and Explanation
  • IF with boolean logic in Excel

Date Time

  • EOMONTH function: Description, Usage, Syntax, Examples and Explanation
  • Calculate total hours that fall between two times in Excel
  • How to show last updated date stamp in Excel
  • YEAR function: Description, Usage, Syntax, Examples and Explanation
  • How to calculate future date say 6 months ahead in Excel

Grouping

  • How to randomly assign data to groups in Excel
  • Group numbers with VLOOKUP in Excel
  • Categorize text with keywords in Excel
  • Map text to numbers in Excel
  • Group times into 3 hour buckets in Excel

General

  • How to get random value from list or table in Excel
  • Select, Insert, Rename, Move, Delete Worksheets in Excel
  • Count cells that do not contain errors in Excel
  • Freeze and Unfreeze Panes in Excel
  • Customize Ribbon In Excel
© 2025 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning