How to Return an Entire Column in Hlookup in Google Sheets

In your horizontal dataset, you may want to use Hlookup to return an entire column’s content. Is it possible? Yes! It is possible in Google Doc Spreadsheets. See How to return an entire column in Hlookup in Google Sheets.

Spreadsheet users are not in favor of the row-wise/horizontal data formatting. Normally column-wise/vertical dataset is easy to handle. Also, most of the functions in Google Sheets are well supported in using a vertical dataset.

But you may have your data horizontally arranged and that may be due to the data imported from some other source or the data is stored as part of form submission. In such datasets, if you want to look up a value, you can use Hlookup.

As I’ve stated above, the function Hlookup is capable of returning an entire column value in the output. See how to do that in the example formula below.

Example: How to Return an Entire Column in Hlookup in Google Sheets

Sample Data:

Lookup a Search Key and Return an Entire Column

Note: The above data is sourced from this Wiki page using the following IMPORTHTML function.

=transpose(query(importhtml("https://en.wikipedia.org/wiki/List_of_waterfalls_by_height","table",2),"Select Col1, Col2, Col3, Col4 limit 10"))

First, understand the data. In this dataset, the first row contains the names of some of the waterfalls in the world.

In the second row, you can find its height, in the third row the locality of the waterfall and in the fifth row the country it resides.

I want to look up one ‘Waterfall’ by its name in the first row and return the details such as height, locality, and country.

The Formula that Returns an Entire Column in Hlookup in Google Sheets

Search_Key: “James Bruce Falls”

Formula:

=ArrayFormula(hlookup("James Bruce Falls",A1:J4,{2;3;4},false))

This formula searches across the first row and successfully finds the search_key in J1. It returns the values from rows 2, 3 and 4. The values are in row-wise. So use the semicolon instead of the comma as the separator.

The row indexes are inside the Curly Brackets and the formula would return an array result. So we should use the function ArrayFormula to wrap the Hlookup formula.

Hlookup with Entire Column Result (Formula Modification)

To return an entire column result in Hlookup, I mean infinite range, replace{2;3;4} (index) in the above formula withrow(A2:A).

=ArrayFormula(IFERROR(hlookup("James Bruce Falls",A1:J4,row(A2:A),false)))

Please note the following points.

  1. You must use Iferror with Hlookup to remove #REF! error in such an open (infinite) range.
  2. Also, use the formula outside the Hlookup range like in cell K1 or L1 as up to column J are occupied in the formula.

The ROW function returns the necessary multiple index numbers 2,3,4… when using within the ArrayFormula.

The same approach you can use in Vlookup but there replace the function ROW with the function COLUMN.

That’s all. Hope you could understand how to return an entire Column in Hlookup in Google Sheets. 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.

Hierarchical Numbering Sequences in Excel

Creating hierarchical numbering sequences in an Excel spreadsheet can significantly improve the way you...

How to Easily Repeat a Sequence of Numbers in Excel

Excel offers multiple ways to accomplish tasks, and the simplicity of each approach depends...

Create a Sequence of Dates at Every Nth Row in Excel (Dynamic Array)

Would you like to create a sequence of dates in every nth row in...

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...

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...

1 COMMENT

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.