+ Reply to Thread
Results 1 to 7 of 7

HLOOKUP formula to return all the values in that column

  1. #1
    Registered User
    Join Date
    07-27-2015
    Location
    Atlanta, GA
    MS-Off Ver
    2010
    Posts
    8

    Exclamation HLOOKUP formula to return all the values in that column

    I need a formula that can find a column header in a table, then return all the values in that column. So if I have a column of text data, it will identify that column based on the header, then return a list of the text values. Sort of like an HLOOKUP, that not only returns the next row value, but the entire column (list)

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: HLOOKUP formula to return all the values in that column

    Try this...

    Data Range
    A
    B
    C
    D
    E
    1
    Header1
    Header2
    Header3
    ------
    Header2
    2
    1
    6
    11
    6
    3
    2
    7
    12
    7
    4
    3
    8
    13
    8
    5
    4
    9
    14
    9
    6
    5
    10
    15
    10
    7


    This formula entered in E2:

    =IFERROR(INDEX(A$2:C$6,ROWS(E$2:E2),MATCH(E$1,A$1:C$1,0)),"")

    Copy down until you get blanks.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: HLOOKUP formula to return all the values in that column

    or (just for variety)

    With the header you want to find in M1 and using Tony's table
    =HLOOKUP($M$1, $A$1:$E$6, ROWS($A$1:$A2), FALSE)
    copied down
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    07-27-2015
    Location
    Atlanta, GA
    MS-Off Ver
    2010
    Posts
    8

    Re: HLOOKUP formula to return all the values in that column

    Great! This is working well (Tony's). Any way to adjust it so that it returns a list of unique values (removing duplicates)

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: HLOOKUP formula to return all the values in that column

    Like this...

    Data Range
    A
    B
    C
    D
    E
    1
    Header1
    Header2
    Header3
    ------
    Header2
    2
    1
    6
    9
    6
    3
    2
    6
    10
    7
    4
    3
    7
    11
    8
    5
    4
    8
    12
    6
    5
    8
    13
    7


    This array formula** entered in E2:

    =IFERROR(INDEX(A$2:C$6,MATCH(0,COUNTIF(E$1:E1,INDEX(A$2:C$6,0,MATCH(E$1,A$1:C$1,0))),0),MATCH(E$1,A$1:C$1,0)),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down until you get blanks.

  6. #6
    Registered User
    Join Date
    12-03-2020
    Location
    Adelaide, Australia
    MS-Off Ver
    O365
    Posts
    2

    Re: HLOOKUP formula to return all the values in that column

    Hi, Appreciate this is an old thread...I have a similar request - but instead of returning unique values, ignore any blank cells in the column and return a continuous list

    Attachment 706950

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,099

    Re: HLOOKUP formula to return all the values in that column

    1. Please read rule 4: "Do not post a new help request in an existing thread."

    2. Start your OWN thread.

    3. Your file did not attach. Read the yellow banner at the top of the page and try again to attach a small sample sheet in your NEW thread, with some manually calculated expecte answers in the place where you expect to see them.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Array Formula To Return Unique Values From a Column Using a Value
    By lucas813 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 02-13-2015, 12:07 PM
  2. [SOLVED] Hlookup to return a sum of values
    By Abe in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-01-2014, 05:08 PM
  3. Replies: 6
    Last Post: 12-11-2013, 05:57 AM
  4. Replies: 10
    Last Post: 10-23-2012, 12:56 PM
  5. Formula to Return non-blank values from a column
    By adamb22 in forum Excel General
    Replies: 4
    Last Post: 05-23-2012, 03:15 PM
  6. hlookup 2 values on 2 rows and sum column
    By dexter87 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2011, 09:50 PM
  7. return values from two cells with hlookup
    By Bry in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-05-2010, 01:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1