Closed Thread
Results 1 to 9 of 9

To find first non blank cell in a row then return column header

  1. #1
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    119

    To find first non blank cell in a row then return column header

    I have this table, which can be seen as a basic custom gantt chart:
    KLRWo.png


    And I would like to fill the A column with start dates, based on the first filled cell of the range on the same row, and the header value of its respective column (row 1). It's easier to show my expected result than write it actually:

    WiMZH.png

    Thanks very much for your help!

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: To find first non blank cell in a row then return column header

    can you please upload a book !
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: To find first non blank cell in a row then return column header

    Hi divi123, perhaps this?

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



    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  4. #4
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: To find first non blank cell in a row then return column header

    Hello DV ! You could use below
    copy and paste in A3
    =IFERROR(INDEX(B$2:P$2,SMALL(IF($B4:$P4<>"",COLUMN($B4:$P4)-COLUMN($B$3)+1),1)),"") then hold control and shift key together then press Enter now release all three keys , and drag down !
    Attached Files Attached Files
    Last edited by hemesh; 01-17-2014 at 06:18 AM.

  5. #5
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: To find first non blank cell in a row then return column header

    A similar and simple way was suggested and it perfectly works well.. could some one help me explaining it

    =IF(COUNTA(B4:G4),INDEX(B$2:G$2,MATCH(TRUE,INDEX(B4:G4<>"",0),0)),"")
    Last edited by divi123; 01-17-2014 at 07:23 AM.

  6. #6
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Chennai
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: To find first non blank cell in a row then return column header

    Even ths suits well

    IF(ISNA(INDEX(B$2:G$2,MATCH(TRUE,INDEX(B6:G6<>"",0),0))),"",INDEX(B$2:G$2,MATCH(TRUE,INDEX(B6:G6<>"",0),0)))

    Thanks guys !!

  7. #7
    Valued Forum Contributor
    Join Date
    12-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2016
    Posts
    506

    Re: To find first non blank cell in a row then return column header

    You're welcome, generally these solutions looked for non-empty cells and return the first match if found, else it'll return an empty string



    _______________________________________________________________________________________________________________________________
    1. Click on the * Add Reputation if you think someone helped you
    2. Mark your thread as SOLVED when question is resolved

    Alvin

  8. #8
    Registered User
    Join Date
    08-17-2021
    Location
    Singapore
    MS-Off Ver
    Office 365
    Posts
    17

    Re: To find first non blank cell in a row then return column header

    Hi,
    how do we find the reverse. Example the last non blank cell in a row then return the column header

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,800

    Re: To find first non blank cell in a row then return column header

    Administrative Note:

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [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
  2. [SOLVED] Find last non blank cell in a row then return column header
    By Chad B in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-13-2013, 10:33 AM
  3. 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
  4. Find last numerical value in row range and return the column header
    By Fidd$ in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-04-2011, 10:15 AM
  5. Find Max values in row then return Column Header
    By mrio in forum Excel General
    Replies: 0
    Last Post: 08-23-2006, 12:47 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