Two Column Output in a Two Way Lookup in Google Sheets

Published on

If the index column in Vlookup is generated using Hlookup or Match, then such Vlookup formula normally does a two-way Lookup. In this Google Docs Sheets guide, I am detailing how to return two column output in a two-way lookup in Google Sheets.

Want ‘n’ column output? I have that solution too! Read on to learn all these tips.

In one way lookup, I mean the traditional Vlookup, it’s quite easy to return multiple column output.

See this generic formula to generate a two column output in a Vlookup (one-way lookup). The “index columns” plays the main role in this formula to return ‘n’ column output.

=ARRAYFORMULA(VLOOKUP(search_key, range, index columns, [is_sorted]))

In this, the “index columns” (the index column numbers) can be entered within Curly Brackets as below.

{2,3}

But in such use, don’t forget to use the ArrayFormula with Vlookup. See the screenshot below to understand one-way Lookup with two column as output.

Two Column Output in a One-way Lookup

Since this is not our topic, other than the above image, I am not going into any more examples related to one-way lookup. You can read that here – Multiple Values Using Vlookup in Google Sheets is Possible.

Similarly above you can get two column output in a two-way lookup in Google Sheets.

Two Column Output in a Two Way Lookup

How to Get Two Column Output in a Two-way Lookup in Google Sheets

Two column output in two way-lookup is relevant since we are unsure about the index column number.

In a two-way Lookup, we are using either the Hlookup or Match function to find the index column number.

So we can’t follow the above one-way lookup approach here (virtual index column array generated using Curly Braces). But it’s somewhat similar. I’ll come to that.

Two-way Lookup with Output from One Column

Understand two-way Vlookup

How to search down the column A for “Employee 2” and search across the row A1:G1 for “Wed, 2 Jan 19”?

I mean how to do this two-way lookup (vertical and horizontal Lookup) to return one column data?

=VLOOKUP("Employee 2",A1:G,MATCH(date(2019,1,2),A1:G1,FALSE),FALSE)

This formula would return the value 8 which is in cell D4. What I want is the values from cell D4 and E4, i.e., two column data.

As a side note, if you are new to two-way lookup, see my guide – How to Perform Two-way Lookup Using Vlookup in Google Sheets. Then come back to read further.

Two-way Lookup with Output from Two Columns

Now here is the tip to get two column output in a two-way Lookup in Google Sheets.

The below Match formula (taken from the above single column lookup returns the number 4 (that is the column number).

=MATCH(date(2019,1,2),A1:G1,FALSE)

That means index column number 4. Now see the modified Match formula. In that, I have used ArrayFormula and a virtual array using Curly Brackets.

=ArrayFormula(MATCH(date(2019,1,2),A1:G1,FALSE)+{0,1})

This formula returns the index column numbers 4 and 5. That means two columns. We can use this in two-way Lookup.

The two-way lookup formula that returns two columns will be as follows.

=ArrayFormula(VLOOKUP("Employee 2",A1:G,MATCH(date(2019,1,2),A1:G1,FALSE)+{0,1},FALSE))

Hope this makes sense.

To return multiple columns, I mean more than two columns or ‘n’ columns, you can use the formula as below.

=ArrayFormula(VLOOKUP("Employee 2",A1:G,MATCH(date(2019,1,2),A1:G1,FALSE)+{0,1,2,3},FALSE))

This Vlookup formula would return a 4 column output. But in this case, there is one more approach. That will be useful for ‘n’ column output. Find that here –Two-way Lookup and Return Multiple Columns in Google Sheets.

That’s all. Enjoy!

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.

Lookup Values Under Categories in Excel and Google Sheets

We can use a combination of XLOOKUP and VLOOKUP in both Excel and Google...

Extract Items Under a Category from the Same Column in Excel

In Excel, you can use a combination of the XLOOKUP and DROP functions to...

How to Create a Searchable Table in Excel Using the FILTER Function

Finding specific records, or rows containing the required information, is straightforward in Excel using...

Time Sequences in Excel by Minute, Hour, or Second Increments

Creating time sequences, whether by hour, minute, or second increments in Excel, can be...

More like this

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

Limit Formula Expansion to a Specific Row in Google Sheets

In this tutorial, I’ll explain how to limit the expansion of an array formula...

3-D Referencing Structured Data Tables in Google Sheets

When you have several tables within a single sheet—not across multiple sheets in a...

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.