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

Data Analysis

  • Conflicting Multiple Conditional Formatting Rules in Excel
  • Excel Frequency Function Example
  • How To Load Analysis ToolPak in Excel
  • How To Create Frequency Distribution in Excel
  • How to calculate correlation coefficient Correlation in Excel

References

  • Count unique text values with criteria
  • How to use Excel COLUMN Function
  • Two-way lookup with VLOOKUP in Excel
  • Find closest match in Excel
  • How to get first column number in range in Excel

Data Validations

  • Excel Data validation require unique number
  • Excel Data validation with conditional list
  • Excel Data validation allow uppercase only
  • Excel Data validation must contain specific text
  • Excel Data validation whole percentage only

Two-way lookup with VLOOKUP in Excel

by

This tutorial shows how to calculate Two-way lookup with VLOOKUP in Excel  using the example below;

Formula

=VLOOKUP(lookup_value,table,MATCH(col_name,col_headers,0),0)

Explanation

Note:

Inside the VLOOKUP function, the column index argument is normally hard-coded as a static number. However, you can also create a dynamic column index by using the MATCH function to locate the right column. This technique allows you to create a dynamic two-way lookup, matching on both rows and columns. It can also make a VLOOKUP formula more resilient: VLOOKUP can break when columns are inserted or removed from a table, but a formula with VLOOKUP + MATCH can continue to work correctly even changes are made to columns.

Worked Example:   Match first occurrence does not contain

Example

In the example, we are using this formula to dynamically lookup both rows and columns with VLOOKUP:

=VLOOKUP(H2,B3:E11,MATCH(H3,B2:E2,0),0)

H2 supplies the lookup value for the row, and H3 supplies the lookup value for the column.

Worked Example:   Left Lookup in Excel

How this formula works

This is a standard VLOOKUP exact match formula with one exception: the column index is supplied by the MATCH function.

Note that the lookup array given to MATCH (B2:E2) representing column headers deliberately includes the empty cell B2. This is done so that the number returned by MATCH is in sync with the table used by VLOOKUP. In other words, you need to give MATCH a range that spans the same number of columns VLOOKUP is using in the table. In the example (for Feb) MATCH returns 3, so after MATCH runs, the VLOOKUP formula looks like this:

=VLOOKUP(H2,B3:E11,3,0)

Which returns sales for Colby (row 4) in Feb (column 3), which is $6,786.

Worked Example:   Find longest string with criteria in Excel

Post navigation

Previous Post:

SUMIFS multiple criteria lookup in table in Excel

Next Post:

VLOOKUP by date in Excel

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
  • IFNA function: Description, Usage, Syntax, Examples and Explanation
  • Nested IF function example in Excel
  • IFS function: Description, Usage, Syntax, Examples and Explanation
  • How to return blank in place of #DIV/0! error in Excel

Date Time

  • TIME function: Description, Usage, Syntax, Examples and Explanation
  • Convert date to month and year in Excel
  • Get days between dates ignoring years in Excel
  • Get first Monday before any date in Excel
  • Convert decimal hours to Excel time

Grouping

  • Group arbitrary text values in Excel
  • Calculate conditional mode with criteria in Excel
  • Group times into unequal buckets in Excel
  • Group numbers with VLOOKUP in Excel
  • Map text to numbers in Excel

General

  • How to get original number from percent change in Excel
  • Check if range contains a value not in another range in Excel
  • Subtotal invoices by age in Excel
  • How to test a range for numbers in Excel
  • With vs Without Array Formula in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning