+ Reply to Thread
Results 1 to 2 of 2

VLOOKUP? If cell has a "1", then return column header

  1. #1
    Registered User
    Join Date
    05-30-2012
    Location
    Arizona, US
    MS-Off Ver
    Excel 2010
    Posts
    1

    VLOOKUP? If cell has a "1", then return column header

    I am looking to find a way to perhaps do a VLOOKUP to pull back the column headers when cells contain a value of "1". Pretty much go from this:

    Customer Apple Banana Pear Peach
    A1122 1 1 1
    A2231 1 1
    A3011 1 1 1
    A4122 1 1 1 1

    To this:

    Customer Prod1 Prod2 Prod3 Prod4
    A1122 Apple Banana Pear
    A2231 Banana Peach
    A3011 Apple Pear Peach
    A4122 Apple Banana Pear Peach

    Can anyone help, please? I am new to this forum and a novice to excel, so any assistance would be greatly appreciated. Thanks!
    Attached Files Attached Files
    Last edited by mattbr80; 05-30-2012 at 03:01 PM. Reason: Adding sample excel spreadsheet

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: VLOOKUP? If cell has a "1", then return column header

    Hi Mattbr80,

    You can use the following formula:-
    {=IFERROR(OFFSET($A$1,0,SMALL(IF($B2:$E2=1,COLUMN($B2:$E2),""),COLUMN(A$1))-1),"")}

    See the attached :-

    Customer Sample Report.xlsx
    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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