+ Reply to Thread
Results 1 to 5 of 5

Trying to find the first instance of a match and return the column header as a result

  1. #1
    Registered User
    Join Date
    03-03-2016
    Location
    Omaha, NE
    MS-Off Ver
    2013
    Posts
    4

    Trying to find the first instance of a match and return the column header as a result

    2 sheets:
    sheet 1: column headers contain dates and the range of data contains job names
    example:
    kruger HS.JPG

    sheet 2: contains the list of jobs that need scheduled, including a column that I want to display the date (first occurrence) of when that job is scheduled.

    kruger HS 2.JPG

    I want column D in sheet 2 to match the job name in column A to the range (B2:G4) and return the column header (date). if job has not been scheduled, I'm cool w/ #NA as the result.

    Thanks!

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Trying to find the first instance of a match and return the column header as a result

    try this formula:
    Please Login or Register  to view this content.
    As it is an array formula, you have to end its editing by pressing CTRL+SHIFT+ENTER at the same time.
    You should see these characters around your formula {}
    You'll probably want to make some of the ranges ABSOLUTE addresses (as in $B$2:$G$4)
    Also, I see a problem as your column A states Kruger but you have Kruger HS in your table.
    This formula works out if you have an EXACT match only.
    Last edited by p24leclerc; 04-06-2017 at 10:11 PM.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Registered User
    Join Date
    03-03-2016
    Location
    Omaha, NE
    MS-Off Ver
    2013
    Posts
    4

    Re: Trying to find the first instance of a match and return the column header as a result

    Almost there,
    if a job is scheduled 3 consecutive days, I want the result to be the first day, not the last.

  4. #4
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Trying to find the first instance of a match and return the column header as a result

    Hi,

    another approach

    =AGGREGATE(15,6,B$1:G$1/($B$2:G$4$="Kruger"),1)

    or

    =AGGREGATE(15,6,B$1:G$1/($B$2:G$4$=A10),1)


    Hope it helps
    Last edited by canapone; 04-07-2017 at 01:03 PM. Reason: ...cosmetics
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Trying to find the first instance of a match and return the column header as a result

    mirk, Please upload a small workbook sample. It gives us something real to reference and work with. Remove any sensitive data.

    If you aren't familiar with how to do this:

    To attach a file to your post,
    • click “Go Advanced” (next to Post Quick Reply – bottom right),
    • scroll down until you see “Manage Attachments”, click that,
    • click “Browse”.
    • select your file(s)
    • click “Upload”
    • click “Close window”
    • click “Submit Reply”
    • be sure to desensitize the data
    The file name will appear at the bottom of your reply.
    Last edited by FlameRetired; 04-07-2017 at 02:01 PM.
    Dave

+ 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. Replies: 2
    Last Post: 07-18-2015, 05:19 PM
  2. Replies: 5
    Last Post: 02-13-2014, 05:37 PM
  3. [SOLVED] Find specific value in table and return header row and header column value
    By nelwan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-30-2013, 01:35 AM
  4. Replies: 4
    Last Post: 07-15-2012, 02:13 PM
  5. Return Column Header from Index/Match function
    By del24ie in forum Excel General
    Replies: 2
    Last Post: 01-12-2012, 11:57 AM
  6. Find a value and return value of the row and column header
    By JG2011 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 10-31-2011, 03:48 AM
  7. Replies: 2
    Last Post: 01-14-2008, 06:13 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