+ Reply to Thread
Results 1 to 6 of 6

Search Table, Display Column Header

Hybrid View

  1. #1
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Search Table, Display Column Header

    Hey, I only just ran a quick search to see if I'd been slated anywhere (I wasn't already aware of!) and came across this and yes you could avoid OFFSET here by using INDEX in such a way as to return all columns for a given row... ie this:

    =INDEX($B$2:$I$2,1,MATCH($B$1,OFFSET($B$2:$I$2,MATCH($A$1,$A$3:$A$32,0),0),0))
    could become

    =INDEX($B$2:$I$2,MATCH($B$1,INDEX($B$3:$I$32,MATCH($A$1,$A$3:$A$32,0),0),0))
    So you run the MATCH of value against a range generated by the INDEX which itself is determined by the MATCH of value 1 against the left hand side column - by setting the column to 0 in the INDEX the range returns all values in that row (ie all columns)... because the final range is a Vector (1 row) you don't actually need to specify both column & row flag you need only specify that which is variable
    (ie for a vertical vector column will always be 1 and for a horizontal vector the opposite is true in so far as the Row will always be 1)

    EDIT: P.S. Flattery gets you everywhere... I don't think I've been referred to as the Master of anything other than of perhaps "disaster"...
    Last edited by DonkeyOte; 08-12-2009 at 02:45 PM.

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

    Re: Search Table, Display Column Header

    Thanks DO!
    Filing that formula away for future reference.
    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

  3. #3
    Registered User
    Join Date
    01-26-2011
    Location
    au
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Search Table, Display Column Header

    is there a way to do this to find the second column header if there are 2 occurences in one row

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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