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.

How to Extract Numbers from Text in Excel with Regex

You can use the REGEXEXTRACT or REGEXREPLACE functions to easily extract numbers from text...

Using OFFSET and MATCH Together in Google Sheets: Advanced Tips

One powerful and flexible way to look up values is by combining the OFFSET...

How to Use OFFSET and XMATCH Functions Together in Excel

We often use the OFFSET and XMATCH functions together to match a value in...

How to Calculate Maximum Drawdown in Excel and Google Sheets

You can use the following dynamic array formula to calculate maximum drawdown (MDD) in...

More like this

Using OFFSET and MATCH Together in Google Sheets: Advanced Tips

One powerful and flexible way to look up values is by combining the OFFSET...

Running Count with Structured References in Google Sheets

Running a count with structured references is achievable in Google Sheets tables using the...

Running Total with Structured Table References in Google Sheets

You can use two types of formulas to create a running total with structured...

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.