+ Reply to Thread
Results 1 to 7 of 7

Return penultimate value in a range

  1. #1
    Registered User
    Join Date
    07-01-2014
    Location
    Glasgow
    MS-Off Ver
    2013
    Posts
    4

    Return penultimate value in a range

    I have a range of cells and I want to return the first value, penultimate value and last value. I have a formula to return the first value and another for the final value but I'm struggling to get a formula to work that will return the penultimate value.

    If, for example, the range is P4:AD4 then not every cell will necessarily have a value as some cells are blank.

    Can anyone help please?

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Return penultimate value in a range

    Hi and welcome to the forum

    Blank as in nothing entered, or blank as in a formula that is showing nothing?

    What formula are you using for the last value?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Return penultimate value in a range

    Try this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  4. #4
    Registered User
    Join Date
    07-01-2014
    Location
    Glasgow
    MS-Off Ver
    2013
    Posts
    4

    Re: Return penultimate value in a range

    This formula taken from another thread seems to work.

    =INDEX(4:4,LARGE(IF(P4:AD4<>"",COLUMN(P4:AD4)),2))

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Return penultimate value in a range

    =INDEX(4:4,LARGE(IF(P4:AD4<>"",COLUMN(P4:AD4)),2)) needs to be array entered tho
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Forum Contributor
    Join Date
    12-23-2003
    Posts
    179

    Re: Return penultimate value in a range

    Could you provide an example where the first value, the penultimate value, and the last value can be seen clearly?

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Return penultimate value in a range

    =index(p4:ad4,large(index((p4:ad4<>"")*(column(p4:ad4)-column(p4)+1),0),2))

+ 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] Penultimate Value in Column
    By Fletch74 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-01-2014, 07:26 PM
  2. [SOLVED] Find Penultimate Non-Blank Cell in Column
    By Jennasis in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-16-2013, 05:11 AM
  3. [SOLVED] Return penultimate value in a range
    By Sophie.Durrant in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-05-2013, 07:00 AM
  4. reverse lookup - last value & penultimate value
    By bowgieman in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-28-2013, 10:17 AM
  5. Penultimate, Second Value in a range
    By Bob@Sun in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-28-2009, 04:25 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