Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 142
Default Display next to last results

This formula works great to find the last entry in a col.
=LOOKUP(99^99,Sheet1!A:A)
Is there a way to get the formula to show the 2nd to the last entry?

Thank you for all you do,
Luke
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,047
Default Display next to last results

you can use

=indirect("Sheet2!A"&counta(Sheet2!a:a)-1)

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"Luke" escreveu:

This formula works great to find the last entry in a col.
=LOOKUP(99^99,Sheet1!A:A)
Is there a way to get the formula to show the 2nd to the last entry?

Thank you for all you do,
Luke

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Display next to last results

If your data in Column A has no gaps in it, this formula can be used...

=OFFSET(A1,COUNTA(A:A)-2,0)

If there are (or can be) gaps in your data, then this formula can be used...

=OFFSET(A1,MATCH(LOOKUP(2,1/(A1:A65535<""),A:A),A:A,0)-2,0)

Rick


"Luke" wrote in message
...
This formula works great to find the last entry in a col.
=LOOKUP(99^99,Sheet1!A:A)
Is there a way to get the formula to show the 2nd to the last entry?

Thank you for all you do,
Luke


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Display next to last results

=OFFSET(A1,MATCH(LOOKUP(2,1/(A1:A65535<""),A:A),A:A,0)-2,0)

That will return incorrect results.

Assuming there will be at least 2 non-empty cells.

Array entered** :

=INDEX(A:A,LARGE(IF(A1:A100<"",ROW(A1:A100)),2))

Since this is an array formula the inner range references can not be entire
columns (unless you're using Excel 2007).

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"Rick Rothstein (MVP - VB)" wrote in
message ...
If your data in Column A has no gaps in it, this formula can be used...

=OFFSET(A1,COUNTA(A:A)-2,0)

If there are (or can be) gaps in your data, then this formula can be
used...

=OFFSET(A1,MATCH(LOOKUP(2,1/(A1:A65535<""),A:A),A:A,0)-2,0)

Rick


"Luke" wrote in message
...
This formula works great to find the last entry in a col.
=LOOKUP(99^99,Sheet1!A:A)
Is there a way to get the formula to show the 2nd to the last entry?

Thank you for all you do,
Luke




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 142
Default Display next to last results

Marcello, the formula returned a blank cell. I think because it is looking
for text and my data is numeric. However I do have blank cells in the column.
Any thoughts?
Luke

"Marcelo" wrote:

you can use

=indirect("Sheet2!A"&counta(Sheet2!a:a)-1)

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"Luke" escreveu:

This formula works great to find the last entry in a col.
=LOOKUP(99^99,Sheet1!A:A)
Is there a way to get the formula to show the 2nd to the last entry?

Thank you for all you do,
Luke



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Display next to last results

Yes, that is true if there is a blank space in the row immediately in front
of the last data item. Good catch. Here is a modification to what I posted
that should work and is non-array entered...

=OFFSET(A1,MATCH(LOOKUP(2,1/(INDIRECT("A1:A"&(MATCH(LOOKUP(2,1/(A1:A65535<""),A:A),A:A,0)-1))<""),A:A),A:A,0)-1,0)

Yeah, it is longer than your array-entered offering, but it seems to work.

Rick


"T. Valko" wrote in message
...
=OFFSET(A1,MATCH(LOOKUP(2,1/(A1:A65535<""),A:A),A:A,0)-2,0)


That will return incorrect results.

Assuming there will be at least 2 non-empty cells.

Array entered** :

=INDEX(A:A,LARGE(IF(A1:A100<"",ROW(A1:A100)),2))

Since this is an array formula the inner range references can not be
entire columns (unless you're using Excel 2007).

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"Rick Rothstein (MVP - VB)" wrote in
message ...
If your data in Column A has no gaps in it, this formula can be used...

=OFFSET(A1,COUNTA(A:A)-2,0)

If there are (or can be) gaps in your data, then this formula can be
used...

=OFFSET(A1,MATCH(LOOKUP(2,1/(A1:A65535<""),A:A),A:A,0)-2,0)

Rick


"Luke" wrote in message
...
This formula works great to find the last entry in a col.
=LOOKUP(99^99,Sheet1!A:A)
Is there a way to get the formula to show the 2nd to the last entry?

Thank you for all you do,
Luke





  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Display next to last results

If you want non-array entered, then try this one

=INDEX(A:A,LARGE(INDEX((A1:A100<"")*ROW(A1:A100), ),2))


"Rick Rothstein (MVP - VB)" wrote:

Yes, that is true if there is a blank space in the row immediately in front
of the last data item. Good catch. Here is a modification to what I posted
that should work and is non-array entered...

=OFFSET(A1,MATCH(LOOKUP(2,1/(INDIRECT("A1:A"&(MATCH(LOOKUP(2,1/(A1:A65535<""),A:A),A:A,0)-1))<""),A:A),A:A,0)-1,0)

Yeah, it is longer than your array-entered offering, but it seems to work.

Rick


"T. Valko" wrote in message
...
=OFFSET(A1,MATCH(LOOKUP(2,1/(A1:A65535<""),A:A),A:A,0)-2,0)


That will return incorrect results.

Assuming there will be at least 2 non-empty cells.

Array entered** :

=INDEX(A:A,LARGE(IF(A1:A100<"",ROW(A1:A100)),2))

Since this is an array formula the inner range references can not be
entire columns (unless you're using Excel 2007).

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"Rick Rothstein (MVP - VB)" wrote in
message ...
If your data in Column A has no gaps in it, this formula can be used...

=OFFSET(A1,COUNTA(A:A)-2,0)

If there are (or can be) gaps in your data, then this formula can be
used...

=OFFSET(A1,MATCH(LOOKUP(2,1/(A1:A65535<""),A:A),A:A,0)-2,0)

Rick


"Luke" wrote in message
...
This formula works great to find the last entry in a col.
=LOOKUP(99^99,Sheet1!A:A)
Is there a way to get the formula to show the 2nd to the last entry?

Thank you for all you do,
Luke





  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Display next to last results

Yeah, that is a lot better than mine (I seem to have been "off" all day
today). Thanks.

Rick


"Teethless mama" wrote in message
...
If you want non-array entered, then try this one

=INDEX(A:A,LARGE(INDEX((A1:A100<"")*ROW(A1:A100), ),2))


"Rick Rothstein (MVP - VB)" wrote:

Yes, that is true if there is a blank space in the row immediately in
front
of the last data item. Good catch. Here is a modification to what I
posted
that should work and is non-array entered...

=OFFSET(A1,MATCH(LOOKUP(2,1/(INDIRECT("A1:A"&(MATCH(LOOKUP(2,1/(A1:A65535<""),A:A),A:A,0)-1))<""),A:A),A:A,0)-1,0)

Yeah, it is longer than your array-entered offering, but it seems to
work.

Rick


"T. Valko" wrote in message
...
=OFFSET(A1,MATCH(LOOKUP(2,1/(A1:A65535<""),A:A),A:A,0)-2,0)

That will return incorrect results.

Assuming there will be at least 2 non-empty cells.

Array entered** :

=INDEX(A:A,LARGE(IF(A1:A100<"",ROW(A1:A100)),2))

Since this is an array formula the inner range references can not be
entire columns (unless you're using Excel 2007).

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"Rick Rothstein (MVP - VB)" wrote
in
message ...
If your data in Column A has no gaps in it, this formula can be
used...

=OFFSET(A1,COUNTA(A:A)-2,0)

If there are (or can be) gaps in your data, then this formula can be
used...

=OFFSET(A1,MATCH(LOOKUP(2,1/(A1:A65535<""),A:A),A:A,0)-2,0)

Rick


"Luke" wrote in message
...
This formula works great to find the last entry in a col.
=LOOKUP(99^99,Sheet1!A:A)
Is there a way to get the formula to show the 2nd to the last entry?

Thank you for all you do,
Luke






  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Display next to last results

Maybe this:
=indirect("Sheet2!A"&count(Sheet2!a:a)-1)

Just a guess...

Regards,
Ryan---



--
RyGuy


"Luke" wrote:

Marcello, the formula returned a blank cell. I think because it is looking
for text and my data is numeric. However I do have blank cells in the column.
Any thoughts?
Luke

"Marcelo" wrote:

you can use

=indirect("Sheet2!A"&counta(Sheet2!a:a)-1)

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"Luke" escreveu:

This formula works great to find the last entry in a col.
=LOOKUP(99^99,Sheet1!A:A)
Is there a way to get the formula to show the 2nd to the last entry?

Thank you for all you do,
Luke

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
How to insert a space between display results Neall Excel Worksheet Functions 2 July 5th 07 05:10 PM
Formula display - no results Wannano Excel Discussion (Misc queries) 3 March 20th 07 06:52 PM
Display results of formulas Helder Excel Worksheet Functions 2 November 7th 06 05:10 PM
Display negative results Rhonda Excel Worksheet Functions 11 October 17th 06 07:24 PM
Select and Display top 5 results laurie g Excel Worksheet Functions 2 September 3rd 06 07:09 PM


All times are GMT +1. The time now is 11:25 PM.

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

About Us

"It's about Microsoft Excel"