+ Reply to Thread
Results 1 to 7 of 7

Find the xth non blank value and display header

  1. #1
    Registered User
    Join Date
    08-28-2019
    Location
    Barcelona
    MS-Off Ver
    2017
    Posts
    12

    Find the xth non blank value and display header

    Hello people!

    I'm getting crazy with this one! I'm trying to merge 2 tables in 1.

    So basically, this is my first table

    example1.png

    I have to fill this 2nd table to order my datas correctly

    example2.png

    So like you can see, I have to find the non blank cell, and display the header. I found several solution to do it, but my problem comes when a row has several datas. It can go up to 3 by rows. So I would like to have in my first column only the first currency, in the second column, only the second one, but if the resources doesn't have a second one, it should show nothing.
    I have the feeling that I will have to use Macro for this one.

    These are the different formulas I tried to solve this problem:
    =INDEX(DB_Resources!$B$1:$BT$1,MATCH(0,(DB_Resources!B2:BT2),-1))
    =INDEX(DB_Resources!$B$1:$BT$1,MATCH(0,(DB_Resources!B2:BT2) * (DB_Resources!B2:BT2 <> (INDEX(DB_Resources!$B$1:$BT$1,MATCH(0,(DB_Resources!B2:BT2),-1)))),-1)) (this one is closed to find the second datas but it doesn't totally work as I would like)
    =INDEX(DB_Resources!$B$1:$BT$1,MATCH(TRUE,INDEX(DB_Resources!B2:BT2<>0,),0))

    I would be so happy if someone can help me!

    Thank you!
    Attached Files Attached Files
    Last edited by Goauld; 08-28-2019 at 08:45 AM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,134

    Re: Find the xth non blank value and display header

    You have attached an image. That's not very easy to work with. Also... I'm lazy. I have to re-type your information before I can begin to address your problem. That puts me off completely. Not only that, but (depending on their choice of browser) many other members cannot even see the image.

    So. Do yourself a favour and please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough). However, please give us an indication of the approximate number of rows of data you want the solution to work with (100, 1000, 100,000 or whatever).

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Make sure confidential info is removed first!!!!
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    08-28-2019
    Location
    Barcelona
    MS-Off Ver
    2017
    Posts
    12

    Re: Find the xth non blank value and display header

    Ok sorry!

    I attached a reduced documents, I think it should work.

    My original file size is 72x72 cells

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,134

    Re: Find the xth non blank value and display header

    Unfortunately, you didn't tell us what your expected results are... so I made a wild guess:

    R2:
    =IFERROR(INDEX($1:$1,AGGREGATE(15,6,COLUMN($B2:$H2)/($B2:$H2<>""),1+INT((COLUMNS($R:R)-1)/2))),"")

    S2:
    =IFERROR(INDEX(2:2,AGGREGATE(15,6,COLUMN($B2:$H2)/($B2:$H2<>""),1+INT((COLUMNS($R:S)-1)/2))),"")

    Select BOTH cells and drag formulae across and down
    Attached Files Attached Files

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,134

    Re: Find the xth non blank value and display header

    You're in BCN.... You may need ; instead of ,

  6. #6
    Registered User
    Join Date
    08-28-2019
    Location
    Barcelona
    MS-Off Ver
    2017
    Posts
    12

    Re: Find the xth non blank value and display header

    Omg I'm so sorry, I'm so into this problem since yesterday that I forget everything.

    But yeah, it's exactly the result I wanted to find

    Thank you very much, I will be more carreful next time when I will post something here.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,134

    Re: Find the xth non blank value and display header

    You're welcome.



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

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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] To find first non blank cell in a row then return column header
    By divi123 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-11-2022, 04:49 AM
  2. [SOLVED] Find last non blank cell & return column header
    By Jamidd1 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 12-18-2017, 07:07 AM
  3. Find last & first non blank cell header
    By Liju144 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-24-2017, 10:46 AM
  4. Find last non blank cell and return the header
    By Newbie403 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-29-2015, 12:12 PM
  5. To find first non blank cell in a row then return column header
    By divi123 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-17-2014, 07:14 AM
  6. [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

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