+ Reply to Thread
Results 1 to 5 of 5

Indexing function from bottom up

  1. #1
    Registered User
    Join Date
    02-06-2014
    Location
    Maui no ka oi
    MS-Off Ver
    MS 365
    Posts
    9

    Indexing function from bottom up

    Hi I have some data & some blanks in cells B31 through B38. Those cells get updated based on formulas that sometimes return blank.

    I need to clear out the blank spaces and put them all in order in Cells B41 to B48.

    I've used this formula to accomplish that:

    =IFERROR(INDEX(B$31:B$38,SMALL(IF(B$31:B$38<>"",ROW(B$31:B$38)-ROW(B$31)+1),ROWS(B$41:B41))),"")

    I that formula is in B41 and entered with Ctrl + Shift + Enter. It enters the data from B31:B38 in order from the top down, and leaves the bottom rows blank if there is space.

    I am hoping there is a way to shift the blank rows to the top, while still preserving the original order.

    For example, if there are two blanks in B31:B38, then I would like B41 & B42 to be blank, followed by the data points.

    Anyone know how I can accomplish that?

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Indexing function from bottom up

    One option, if I've understood...

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


    use of inner INDEX in Small to negate need for Array entry -- no more efficient, however.

  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
    44,099

    Re: Indexing function from bottom up

    or:

    =IFERROR(INDEX(B:B,AGGREGATE(15,6,ROW($B$31:$B$38)/($B$31:$B$38<>""),ROWS(B$41:B41))),"")

    copied down. Since you have Excel 2010+ you can take advantage of AGGREGATE and avoid the use of arrays, too.
    Attached Files Attached Files
    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

  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,099

    Re: Indexing function from bottom up

    Ooops. I put the blanks to the bottom...

  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,099

    Re: Indexing function from bottom up

    The AGGREGATE version of Xlents solution (blanks first) is:
    =IF(ROWS(F$41:F41)<=COUNTBLANK($B$31:$B$38),"",INDEX(B:B,AGGREGATE(15,6,ROW($B$31:$B$38)/($B$31:$B$38<>""),ROWS(F$41:F41)-COUNTBLANK($B$31:$B$38))))

    It's a bit longer than Xlents... and no more/less efficient, so go with his.

+ 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. Match Function from Bottom to Top in VBA
    By AmirSoft in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-13-2016, 10:02 AM
  2. Identify top 3, bottom 3 and intermediate values using IF function
    By nataliebenjamin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-17-2012, 03:28 PM
  3. Replies: 7
    Last Post: 10-10-2010, 02:02 PM
  4. Excel Indexing Function
    By MCDST070-271 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-29-2006, 03:55 PM
  5. [SOLVED] Add function at bottom of Spreadsheet
    By JOUIOUI in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-05-2006, 07:25 AM
  6. Replies: 1
    Last Post: 04-09-2006, 04:30 PM
  7. [SOLVED] IF function?-add a row to the bottom
    By YanYan in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 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