+ Reply to Thread
Results 1 to 5 of 5

Need Index/Match to find the first non-blank cell and return the value in the top row

  1. #1
    Registered User
    Join Date
    02-14-2018
    Location
    UK
    MS-Off Ver
    Office 15
    Posts
    3

    Need Index/Match to find the first non-blank cell and return the value in the top row

    I have a list of clients (one row per client) and their data by month (one column per month), I need an Index/Match or Lookup formula to find the first non-blank cell on the row and return the month it corresponds to (The months are in row 1).

    I have attached the sheet I am using to test it.
    Attached Files Attached Files

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Need Index/Match to find the first non-blank cell and return the value in the top row

    Hello and welcome to the forum.

    Try this:

    B2 =INDEX(C$1:I$1,INDEX(MATCH(TRUE,C2:I2<>"",0),0))

  3. #3
    Registered User
    Join Date
    02-14-2018
    Location
    UK
    MS-Off Ver
    Office 15
    Posts
    3

    Re: Need Index/Match to find the first non-blank cell and return the value in the top row

    *boom*

    Looks like a winner. Thanks so much! Three minutes! Amazing

    I will have to unpick it now as neeeeeeeeeeeed to know how/why it works

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Need Index/Match to find the first non-blank cell and return the value in the top row

    Happy to help. Thanks for the rep!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Note that this formula can also be array-entered like this: =INDEX(C$1:I$1,MATCH(TRUE,C2:I2<>"",0)) Ctrl Shift Enter

    Basically, it forms an array of logical tests {C2<>"",D2<>"",E2<>"",F2<>"",G2<>"",H2<>"",I2<>""} which turns into {FALSE,FALSE,TRUE,TRUE,FALSE,TRUE,FALSE}.
    The MATCH function then returns the first instance of the lookup value (which was TRUE in this case) which is in the third column.

    The INDEX function then returns the third value from the range C1:I1, which is "Mar".

  5. #5
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,292

    Re: Need Index/Match to find the first non-blank cell and return the value in the top row

    f
    ormulas
    with massive input
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    without
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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. [SOLVED] Index Match return first non blank value
    By nhoj in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-12-2018, 12:34 AM
  2. 2-dimensional index match, return nth non-blank value?
    By JMB10101 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-29-2016, 01:55 AM
  3. [SOLVED] IF <=0 INDEX MATCH LARGE otherwise return blank
    By augr in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 11-14-2016, 05:34 PM
  4. Index/ Match Formula, How to return blank cell as a blank not 0
    By MDResearcher in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-24-2016, 08:40 PM
  5. [SOLVED] IF date value returned from Index/Match is blank, return prior cell that returns a value
    By gunnerau in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-11-2014, 08:40 PM
  6. Index/Match to return a blank cell
    By Nick_in_Dubai in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-26-2012, 06:36 AM
  7. Replies: 2
    Last Post: 10-21-2011, 01:41 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