+ Reply to Thread
Results 1 to 5 of 5

Display last and second last values from populated cells in a column. Say A1:A10 with

  1. #1
    Registered User
    Join Date
    12-03-2009
    Location
    Winterton, NL, Canada
    MS-Off Ver
    Excel 2007
    Posts
    2

    Display last and second last values from populated cells in a column. Say A1:A10 with

    This could apply where it is required to generate the number of hours of work in each of the last two working weeks in a 10 week period. Not all 10 weeks will have hours; some will be blank. The formula should remain true in another 10 week period with different weeks being blank. What are the formulas to display the results in A11 and A12?
    Last edited by gjtucker; 12-03-2009 at 10:29 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Display last and second last values from populated cells in a column. Say A1:A10

    Your post is hard to follow - I'm afraid - could you post an example ?

    Finding the last value is straightforward enough

    =LOOKUP(9.99999999999999E+307,A1:A10)

    The approach for finding the penultimate value will vary based on specifics of the file... of which we know little.

    =LOOKUP(9.99999999999999E+307,A1:INDEX(A1:A10,MATCH(9.99999999999999E+307,A1:A10)-1))

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Display last and second last values from populated cells in a column. Say A1:A10

    If range is A1:A8

    Then Last value:

    =LOOKUP(9.9999999E+307,$A$1:$A$8)

    2nd last:

    =LOOKUP(9.9999999E+307,A1:INDEX($A$1:$A$8,MATCH(9.9999999E+307,$A$1:$A$8)-1),$A$1:$A$8)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    12-03-2009
    Location
    Winterton, NL, Canada
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Display last and second last values from populated cells in a column. Say A1:A10

    A1:A10 has the following entries:

    A1 = 10, A2 = !5, A3 = BLANK, A4 = 20, A5 = 25, A6 = 30, A7 = BLANK, A8 = 35, A9 = BLANK, A10 = 40.

    Formula in A11 to return 35 ???
    Formula in A12 to return 40 ???

    Formulas to remain valid when values in A1:A10 are changed.

    Thanks for your reply. My apology for the obscurity of my post.

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Display last and second last values from populated cells in a column. Say A1:A10

    The formulae provided should do what you want just place that for last value in A12 and the penultimate in A11.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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