Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 90
Default 2nd and 3rd last number in a column - how to get it?

Hi there,
I currently have a table from columns V3 to AM1000. The cells contain
numbers varying from 0 to 50. I have a formula in place that calculates the
last number in the column:

=LOOKUP(2,1/(V$3:V$1000<""),V$3:V$1000)

what I'm looking for is 2 formulas,
- one that will return the 2nd last number in the column into cell AP3
- one that will return the 3rd last number in the column into cell AQ3

Ex.

ColumnV looks like the following:

0
1
0
1
2
3
0
0

Now, my forumla gives my 0 as the last number. I would like AP3 to show the
2nd last number (0) and AQ3 to show (3) as it's the 3rd last number.

Thanks!
Matt


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default 2nd and 3rd last number in a column - how to get it?

In AP3 enter =OFFSET(INDEX($V3:$V1000,MATCH(99^99,$V3:$V1000)),-1,0)

In AQ3 enter =OFFSET(INDEX($V3:$V1000,MATCH(99^99,$V3:$V1000)),-2,0)


Gord Dibben MS Excel MVP


On Mon, 11 Feb 2008 11:48:02 -0800, mpenkala
wrote:

Hi there,
I currently have a table from columns V3 to AM1000. The cells contain
numbers varying from 0 to 50. I have a formula in place that calculates the
last number in the column:

=LOOKUP(2,1/(V$3:V$1000<""),V$3:V$1000)

what I'm looking for is 2 formulas,
- one that will return the 2nd last number in the column into cell AP3
- one that will return the 3rd last number in the column into cell AQ3

Ex.

ColumnV looks like the following:

0
1
0
1
2
3
0
0

Now, my forumla gives my 0 as the last number. I would like AP3 to show the
2nd last number (0) and AQ3 to show (3) as it's the 3rd last number.

Thanks!
Matt


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default 2nd and 3rd last number in a column - how to get it?

As long as there are no empty/blank/text cells within the range:

2nd to last:

=INDEX(V$3:V$1000,COUNT(V$3:V$1000)-1)

3rd to last:

=INDEX(V$3:V$1000,COUNT(V$3:V$1000)-2)

For the last number:

=LOOKUP(1E100,V$3:V$1000)


--
Biff
Microsoft Excel MVP


"mpenkala" wrote in message
...
Hi there,
I currently have a table from columns V3 to AM1000. The cells contain
numbers varying from 0 to 50. I have a formula in place that calculates
the
last number in the column:

=LOOKUP(2,1/(V$3:V$1000<""),V$3:V$1000)

what I'm looking for is 2 formulas,
- one that will return the 2nd last number in the column into cell AP3
- one that will return the 3rd last number in the column into cell AQ3

Ex.

ColumnV looks like the following:

0
1
0
1
2
3
0
0

Now, my forumla gives my 0 as the last number. I would like AP3 to show
the
2nd last number (0) and AQ3 to show (3) as it's the 3rd last number.

Thanks!
Matt




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 90
Default 2nd and 3rd last number in a column - how to get it?

Thanks Gord - works great!

Matt

"Gord Dibben" wrote:

In AP3 enter =OFFSET(INDEX($V3:$V1000,MATCH(99^99,$V3:$V1000)),-1,0)

In AQ3 enter =OFFSET(INDEX($V3:$V1000,MATCH(99^99,$V3:$V1000)),-2,0)


Gord Dibben MS Excel MVP


On Mon, 11 Feb 2008 11:48:02 -0800, mpenkala
wrote:

Hi there,
I currently have a table from columns V3 to AM1000. The cells contain
numbers varying from 0 to 50. I have a formula in place that calculates the
last number in the column:

=LOOKUP(2,1/(V$3:V$1000<""),V$3:V$1000)

what I'm looking for is 2 formulas,
- one that will return the 2nd last number in the column into cell AP3
- one that will return the 3rd last number in the column into cell AQ3

Ex.

ColumnV looks like the following:

0
1
0
1
2
3
0
0

Now, my forumla gives my 0 as the last number. I would like AP3 to show the
2nd last number (0) and AQ3 to show (3) as it's the 3rd last number.

Thanks!
Matt



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default 2nd and 3rd last number in a column - how to get it?

Thanks for the feedback.

See also Biff's shorter suggestion if you have no blanks.


Gord

On Mon, 11 Feb 2008 12:26:31 -0800, mpenkala
wrote:

Thanks Gord - works great!

Matt

"Gord Dibben" wrote:

In AP3 enter =OFFSET(INDEX($V3:$V1000,MATCH(99^99,$V3:$V1000)),-1,0)

In AQ3 enter =OFFSET(INDEX($V3:$V1000,MATCH(99^99,$V3:$V1000)),-2,0)


Gord Dibben MS Excel MVP


On Mon, 11 Feb 2008 11:48:02 -0800, mpenkala
wrote:

Hi there,
I currently have a table from columns V3 to AM1000. The cells contain
numbers varying from 0 to 50. I have a formula in place that calculates the
last number in the column:

=LOOKUP(2,1/(V$3:V$1000<""),V$3:V$1000)

what I'm looking for is 2 formulas,
- one that will return the 2nd last number in the column into cell AP3
- one that will return the 3rd last number in the column into cell AQ3

Ex.

ColumnV looks like the following:

0
1
0
1
2
3
0
0

Now, my forumla gives my 0 as the last number. I would like AP3 to show the
2nd last number (0) and AQ3 to show (3) as it's the 3rd last number.

Thanks!
Matt




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
Count number of cells and total in one column, based on another column suffix Pierre Excel Worksheet Functions 5 October 31st 07 12:28 AM
Finding a number in a column out of an array in another column cirena Excel Discussion (Misc queries) 3 April 4th 07 06:30 PM
Display missing Part Number if Column A does not match column B Erik T Excel Worksheet Functions 2 April 17th 06 11:23 PM
how i write a number on a column A and see that number on letters. Mauricio Excel Worksheet Functions 2 March 12th 06 09:29 PM
Auto number w/ different letter-number combos in same column Colleen B Excel Worksheet Functions 2 February 23rd 05 02:41 PM


All times are GMT +1. The time now is 12:24 AM.

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"