+ Reply to Thread
Results 1 to 9 of 9

Second to last non-empty cell

  1. #1
    Forum Contributor
    Join Date
    08-19-2012
    Location
    Sydney
    MS-Off Ver
    MS Office 365/16
    Posts
    282

    Second to last non-empty cell

    Hi all,

    I am trying to get an output in cell A5 where i am looking to find the second-to-last non-empty cell in a row range from B5:AJ5

    Many thanks

  2. #2
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Taiwan
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,380

    Re: Second to last non-empty cell

    Good morning welcome to the forum

    Fast answers need clear examples. Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information (10-20 rows, not thousands...) and some manually calculated results. Just before posting, scroll down to GO ADVANCED, click, and then scroll down to MANAGE ATTACHMENTS and click again. Now follow the instructions at the top of that screen

  3. #3
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,899

    Re: Second to last non-empty cell

    Try this:

    =INDEX(B5:AJ5,AGGREGATE(14,6,COLUMN(B5:AJ5)/(B5:AJ5<>""),2)-1)

  4. #4
    Forum Contributor
    Join Date
    08-19-2012
    Location
    Sydney
    MS-Off Ver
    MS Office 365/16
    Posts
    282

    Re: Second to last non-empty cell

    Hi,

    I have attached a document that demonstrates what I am looking for. Hope this helps.
    Attached Files Attached Files

  5. #5
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    Taiwan
    MS-Off Ver
    365 V2403 and WPS V2022
    Posts
    3,380

    Re: Second to last non-empty cell

    E5 cell , Array formula,Drag down

    HTML Code: 

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Second to last non-empty cell

    Please try

    =INDEX($5:$5,LARGE(INDEX(COLUMN($J$5:$Z$5)*($J$5:$Z$5>0),),ROWS(F$5:F5)))

    or not use whole Row
    =INDEX($J$5:$Z$5,LARGE(INDEX(COLUMN($J$5:$Z$5)*($J$5:$Z$5>0),),ROWS(F$5:F5))-COLUMN($J$5)+1)

    and use =LOOKUP("Ω",J5:Z5) for last non blank text
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    08-19-2012
    Location
    Sydney
    MS-Off Ver
    MS Office 365/16
    Posts
    282

    Re: Second to last non-empty cell

    Thanks guys for your response. Sorry I should have set the layout better. I want the results to go across, not down. I have attached an updated version.

    Regards,
    Attached Files Attached Files

  8. #8
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Second to last non-empty cell

    H5
    =INDEX($J$5:$Z$5,LARGE(INDEX(COLUMN($J$5:$Z$5)*($J$5:$Z$5>0),),COLUMNS($H5:H5))-COLUMN($J$5)+1)

    copy to E5
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    08-19-2012
    Location
    Sydney
    MS-Off Ver
    MS Office 365/16
    Posts
    282

    Re: Second to last non-empty cell

    this works great. Many thanks as always

+ 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. Replies: 3
    Last Post: 08-30-2020, 02:07 AM
  2. [SOLVED] Subtracting a 0 from a empty cell and wanting to return a empty cell
    By trekathlete in forum Excel General
    Replies: 5
    Last Post: 10-18-2019, 07:17 AM
  3. Move last cell in column to the next right empty cell if row in sheet is empty
    By Daijhan97 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-23-2019, 07:05 AM
  4. [SOLVED] Using macro to find first empty cell in column. If range is empty returns error.
    By A440 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 05-23-2019, 11:03 AM
  5. [SOLVED] vba code to find and paste data to next empty cell, not last empty cell
    By hkbhansali in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-21-2018, 10:48 AM
  6. [SOLVED] Paste formula to the last empty cell based on a non-empty cell on another column
    By bhenlee in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-02-2015, 04:07 PM
  7. Need to find empty filled cells in a column and copy to the empty cell below
    By Grahamfeeley in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-30-2014, 10:09 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