+ Reply to Thread
Results 1 to 8 of 8

Index from bottom to top

  1. #1
    Registered User
    Join Date
    06-06-2017
    Location
    Illinois
    MS-Off Ver
    Excel 2016
    Posts
    25

    Index from bottom to top

    Hello all,

    I'm working on a formula that will check column D, from bottom to top, for a number entered in column D, and will return the date in column A. So far, the formula I have is

    =IFERROR(INDEX($A:$D,MATCH(D2,D:D,0),1),"")

    It works, but it works from top to bottom. Is there any easy way to make it go from bottom to top?

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Index from bottom to top

    =IFERROR(INDEX($A:$D,MATCH(D2,D:D),1),"")
    if data in D:D in ascending order

  3. #3
    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
    43,984

    Re: Index from bottom to top

    =LOOKUP(10^300,$a$2:$a$100/($d$2:$d$100=d2))

    if this isn't right...

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    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.
    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Registered User
    Join Date
    06-06-2017
    Location
    Illinois
    MS-Off Ver
    Excel 2016
    Posts
    25

    Re: Index from bottom to top

    I forgot a key part of this, and that's my fault. The formula needs to ignore the row that it's in. The formula Tim gave works perfectly, but it includes the line that the formula is in, which won't work for what I'm trying to do.

    I tried attaching a file, but when I press the attach button it just shows me a white line.

  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
    43,984

    Re: Index from bottom to top

    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.

    And how did my formula fail??

  6. #6
    Registered User
    Join Date
    06-06-2017
    Location
    Illinois
    MS-Off Ver
    Excel 2016
    Posts
    25

    Re: Index from bottom to top

    Let's see if this works.

    And your formula kind of worked. But it was doing the same thing as Tim's: It's not ignoring the data in column A in the column that it's in.

    In an ideal world, what will happen is data will get put into a cell in column D. If that data has been entered into a previous row in column D, the formula will pull the data from column A from the previous row.

    I can do this no problem with a macro that runs on sheet change, but they want this done with just a formula for one reason or another.
    Attached Files Attached Files

  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
    43,984

    Re: Index from bottom to top

    In I2, an arrat formula, copied down:

    =IF(COUNTIF($D$2:D2,D2)>1,INDEX(Sheet1!A:A,LARGE(IF($D$2:D2=D2,ROW($D$2:D2)),2)),"")

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...

  8. #8
    Registered User
    Join Date
    06-06-2017
    Location
    Illinois
    MS-Off Ver
    Excel 2016
    Posts
    25

    Re: Index from bottom to top

    I can't say that I understand it, but this works beautifully. You just saved me a huge headache, thank you very much!

+ 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] Bottom Command Button does not take the user to the bottom of the ListBox
    By JJFletcher in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-08-2017, 03:21 PM
  2. [SOLVED] Need INDEX MATCH formula that arranges Xs in bottom rows and then starts arranging ys
    By bkwins in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-05-2013, 09:16 AM
  3. Draw bottom border on every rows from top to bottom
    By tantcu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-08-2013, 09:52 AM
  4. Match/Index/Lookup - Searching From Bottom to Top (A reverse lookup maybe)
    By Neutralizer in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-02-2013, 03:55 AM
  5. Index, match, duplicates in array - how to pick up the last/bottom line
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-25-2011, 08:02 PM
  6. [SOLVED] Index Match Two columns Find Last Bottom
    By henryriver1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-26-2006, 11:55 AM
  7. Replies: 1
    Last Post: 04-09-2006, 04:30 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