HomeGoogle DocsSpreadsheetHow to Perform Two-way Lookup Using Vlookup in Google Sheets

How to Perform Two-way Lookup Using Vlookup in Google Sheets

Published on

In the real sense, two-way lookup using Vlookup in Google Sheets is not possible without making a combination formula.

The recommended functions to use with Vlookup are Match or Hlookup.

Two-way lookup means to lookup one search key in the first column and another search key in the first row of a table and returns the intersecting value.

In Google Sheets, to make the two-way lookup using Vlookup works, you should use either of the above-said functions to form a powerful combination.

Let me explain it more clearly.

Here is the Syntax of the normal one-way Lookup formula – Vertical Lookup

VLOOKUP(search_key, range, index, [is_sorted])

The Syntax of Two-way Lookup formula – The combination of Vertical and Horizontal Lookup

Here there are two options and the first one is using the functions Vlookup and Match.

VLOOKUP(search_key, range, Match, [is_sorted])

No doubt, you can combine Vlookup and Hlookup too for two-way lookup in Google Sheets.

VLOOKUP(search_key, range, Hlookup, [is_sorted])

Must Check: Learn All Popular Google Sheets Functions

Can you tell me which one is better?

If this is your question, no doubt, for me, both are almost the same in usability. Any of the above combinations can do vertical and horizontal lookup together.

Also, with both of these combinations, array results (multiple search keys) are possible.

This Google Sheets tutorial is about the Vlookup and Match combination for two-way lookup.

Regarding the Vlookup and Hlookup combination, please refer to this guide – Vlookup and Hlookup Combination In Google Sheets.

Two-way Lookup Using Vlookup in Google Sheets

You can use multiple keywords in this type of two-way lookup.

In the first example below, I will use only one/single keyword each, that in the first column (vertical lookup) and first row (horizontal lookup).

That means it’s a non-array formula.

Two-way Lookup in Google Sheets – Non-Array Formula

Example:-

I hope this picture or infographic can convey everything that I want to say about two-way lookups.

Two-way Lookup in Google Sheets

Formula # 1: Normal Two-way lookup formula in Google Sheets.

In my above example, I have inserted the following formula in cell H3, which returns the mark of “Student 2” in the Subject Physics, which is 76.

=IFERROR(VLOOKUP(F3,A2:D,MATCH(G3,A2:D2,0),0))

Do you know how this two-way lookup using Vlookup in Google Sheets works?

To understand this see the below Vlookup formula.

=IFERROR(VLOOKUP(F3,A2:D,3,0))

It is equal to the above formula # 1!

Column Index # 3 in this formula refers to the third column in the data range containing the marks of “Student 2.”

Here is the difference.

The MATCH formula in formula # 1 returns this number 3 (relative position) by searching the keyword, i.e., “Student 2”.

Two-way Lookup in Google Sheets – Array Formula

Let’s see how to deal with multiple search keys in two-way lookup using Vlookup and Match combination formula.

Example:-

Two-way Lookup array formula in Google Sheets

Here is the two-way lookup array formula, which you can see in the above example.

Formula # 2: Array-Based Two-way lookup formula in Google Sheets.

=ArrayFormula(IFERROR(VLOOKUP(F3:F,A2:D,match(G3:G,A2:D2,0),0)))

It is not much different from formula # 1.

Just include the range that contains the keywords. I mean, replace F3 with F3: F and G3 with G3: G.

Additionally, wrap the formula with the ArrayFormula for expanding the results.

Additional Lookup Tips for the Geeks

At the beginning of this Google Spreadsheet tutorial, I have mentioned using Hlookup instead of the Match function.

Yes! Two-way lookup in Google Sheets is also possible with the Vlookup and Hlookup combination.

You can use this new combination formula also in non-array or array form.

For example, this formula can replace the array formula #2 above.

=ArrayFormula(IFERROR(VLOOKUP(F3:F,A2:D,HLOOKUP(G3:G,{A2:D2;COLUMN(A2:D2)},2,0),0)))

Conclusion

I have provided the best available formula combinations for two-way lookup using Vlookup in Google Sheets.

If you have any doubts regarding the formulas detailed in this post, you may feel free to ask me in the comments.

I’ll try to simplify the steps for you.

Thanks, and I hope you have enjoyed the stay!

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Counting XLOOKUP Results with COUNTIFS in Excel and Google Sheets

We can use COUNTIF or COUNTIFS alongside an XLOOKUP formula to conditionally count the...

Appointment Schedule Template in Google Sheets

An appointment schedule template in Google Sheets can assist you in efficiently managing your...

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Running Total By Month in Excel

This tutorial demonstrates how to calculate the running total by month in a range...

More like this

Appointment Schedule Template in Google Sheets

An appointment schedule template in Google Sheets can assist you in efficiently managing your...

Creating Sequential Dates in Equally Merged Cells in Google Sheets

Do you know how to create sequential dates in equally merged cells across a...

Interactive Random Task Assigner in Google Sheets

You have multiple tasks and multiple people. Here's a fun way to randomly assign...

19 COMMENTS

  1. Hi,

    Thank you for the article. There is a big dataset I am working on wherein I am making a dashboard for 2-wheeler monthly sales across different states and cities.

    In the dashboard, I have a dropdown menu for selecting the state, and I would like to showcase a plot for city sales in that particular state.

    To achieve that, I need a dynamic helper table that updates on month and state selection. Can you please help me with that?

      • Dear Prashanth,

        Thank you for your quick response. I was working on it yesterday and was able to solve it, but I still feel like there has to be an easier or quicker way to use smart formulas.

        Here is the link to the sheet I copied: [URL removed]

        Could you take a look and see if there’s a way to simplify the formula?

        Thank you so much again for your support!

  2. Thank you very much.

    Can you please help me,

    From your table, I need a formula to Lookup the Subject.

    Example:

    Question: what is the Subject with value 76 owned by “Student 2”?

    Answer: “Physics”

    I need a Google Sheets formula that returns the result, i.e., “Physics.”

    Please email me the answer. Thank you.

  3. I need someone’s help with this.

    I need help with Vlookup and between 2 dates. I got it returning the correct highest number.

    But now I need it to return the name of the salesman who had “highest gross” and was “between these two dates.”

    Can someone please help me with this? Here is the link to the sheet: — LINK REMOVED BY ADMIN —

    Look at Page “NEW MONTHLY TOTALS” on cell #J64, and this is where I am trying to get the “Name” of the person who had “HIGHEST USED FRONTEND GROSS” from the “PRE-OWNED VEHICLES (in cells M6:M155)” Page.

    The cells that have the “Date of Sale” are on “PRE-OWNED VEHICLES (in cells B6:B155)” but must be between the date range “NEW MONTHLY TOTALS cells between C62 and F62.”

    • Hi, Anthony Ousley,

      You can try this formula in cell J64.

      =vlookup(
      H64,
      filter(
      {'PRE-OWNED VEHICLES'!M6:M155,'PRE-OWNED VEHICLES'!D6:D155},
      isbetween('PRE-OWNED VEHICLES'!B6:B155,'NEW MONTHLY TOTALS'!C62,'NEW MONTHLY TOTALS'!F62)
      ),2,0
      )

      FILTER and ISBETWEEN are the functions used other than VLOOKUP.

  4. My company does not allow sharing outside the company.

    So I have slimmed down what I have and copied it into my google account. Here is the link.

    — link removed by the admin —

    I appreciate the help on this.

    • Hi, Jim Spalding,

      I made copies of your tabs, and they are “Copy of Delivery” and “Copy of Schedule.”

      Then I have modified your existing data in these copied sheets for testing.

      You can find the formula in cell P3 in “Copy of Schedule.”

  5. I need some assistance in doing something similar, and I have struggled to make it work.
    I am trying to pull data from one tab into another for the delivery schedule of parts into a production schedule that has this part as a component.
    I want to see how many are being delivered for that day, and it looks out five days.
    It is a table in which part numbers are in column A, dates are in row 1, with the quantity for each part at the intersection of the row and column.
    The destination sheet has five columns representing the days of the week with the date as header, and the part number is in the rows.
    I have an example google sheet I can share.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.