Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 177
Default Lookup the 2nd to last cell used in a column

How do I modify this:

=LOOKUP(2,1/(A1:A10<""),A1:A10)

which looks up the last value in a column so it instead retrieves the second
to last value in a column, third to last value in a column, fourth to last,
etc.

offset this value -1 somehow? or -2, -3 etc... not sure how to use OFFSET

thanks very much!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 177
Default Lookup the 2nd to last cell used in a column

=LOOKUP(MAX(Data!B3:B500)-1,Data!B3:B500)
=LOOKUP(MAX(Data!B3:B500)-2,Data!B3:B500)
=LOOKUP(MAX(Data!B3:B500)-3,Data!B3:B500)
etc

"SteveC" wrote:

How do I modify this:

=LOOKUP(2,1/(A1:A10<""),A1:A10)

which looks up the last value in a column so it instead retrieves the second
to last value in a column, third to last value in a column, fourth to last,
etc.

offset this value -1 somehow? or -2, -3 etc... not sure how to use OFFSET

thanks very much!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 527
Default Lookup the 2nd to last cell used in a column



"SteveC" wrote:

How do I modify this:

=LOOKUP(2,1/(A1:A10<""),A1:A10)

which looks up the last value in a column so it instead retrieves the second
to last value in a column, third to last value in a column, fourth to last,
etc.

offset this value -1 somehow? or -2, -3 etc... not sure how to use OFFSET


If you want to reverse the list copy this into row 1 and copy down:
=INDEX($A$1:$A$10,(COUNTA($A$1:$A$10)-ROW()+1))

if you want to just pick from the list and enter the number in B2 to be
picked 4 willl give you the fourth entry from the bootom of the list:

=INDEX($A$1:$A$10,(COUNTA($A$1:$A$10)-B2+1))

Regards
Peter
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Lookup the 2nd to last cell used in a column

Assuming no blank cells in between the data

=INDEX(A:A,COUNT(A:A)-1)


"SteveC" wrote:

How do I modify this:

=LOOKUP(2,1/(A1:A10<""),A1:A10)

which looks up the last value in a column so it instead retrieves the second
to last value in a column, third to last value in a column, fourth to last,
etc.

offset this value -1 somehow? or -2, -3 etc... not sure how to use OFFSET

thanks very much!

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Lookup the 2nd to last cell used in a column

Another way...

=INDEX(A1:A7,ROWS(A1:A7)-1)


"SteveC" wrote:

How do I modify this:

=LOOKUP(2,1/(A1:A10<""),A1:A10)

which looks up the last value in a column so it instead retrieves the second
to last value in a column, third to last value in a column, fourth to last,
etc.

offset this value -1 somehow? or -2, -3 etc... not sure how to use OFFSET

thanks very much!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
lookup column label based on data in cell Aaron Excel Worksheet Functions 1 August 22nd 06 04:13 PM
Lookup in one column, and return value from another column fdebelo Excel Worksheet Functions 2 January 8th 06 01:55 PM
Lookup One Column - Sum Another pw034 Excel Worksheet Functions 2 December 29th 05 01:26 PM
Column Lookup N Harkawat Excel Discussion (Misc queries) 1 June 14th 05 03:39 PM
Calculating totals in a column based on a lookup in another column Michael Wright via OfficeKB.com Excel Worksheet Functions 1 April 15th 05 09:52 AM


All times are GMT +1. The time now is 08:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"