Getting Last Numeric Value In Column

I used to use excel and have switched to Numbers but now I'm kinda' stuck. How can I retrieve the last numeric value in a defined column. In Excel I would do it as:

=VLOOKUP(9.9999999999E+307,K,1)

With excel that gives me the last value in a column. In Numbers this formula renders the highest value of that column.

Any ideas, thanks in advance from the cloud forests of Guatemala

MacBook Pro, Mac OS X (10.6.3)

Posted on Apr 9, 2011 5:23 AM

Reply
Question marked as Top-ranking reply

Posted on Apr 9, 2011 11:08 PM

Interesting that VLOOKUP works that way in Excel, and I verified it does so in Excel for Mac 2011. The description of the function is the same as for Numbers:

"If TRUE or omitted, an approximate match is returned. In other words, if an exact match is not found, the next largest value that is less than lookup_value is returned."

In other words, it is not operating as described. It should be finding the maximum value in your column, not the lowermost row that has a value.

Jerry gave the answer if there are no blank rows interspersed in the list and the column contains only numbers.

If this is not the case, I don't think there is a one-cell formula but there are ways that use a column and a formula. One way is

B = your list of numbers, empty rows, letters, etc.
C=IF(OR(ISBLANK(B),ISERROR(B/1)),"",ROW()) -> puts row numbers next to numeric values only
Answer =LOOKUP(MAX(C),C,B) ->returns value in the highest marked row
9 replies
Question marked as Top-ranking reply

Apr 9, 2011 11:08 PM in response to cloud forest kid

Interesting that VLOOKUP works that way in Excel, and I verified it does so in Excel for Mac 2011. The description of the function is the same as for Numbers:

"If TRUE or omitted, an approximate match is returned. In other words, if an exact match is not found, the next largest value that is less than lookup_value is returned."

In other words, it is not operating as described. It should be finding the maximum value in your column, not the lowermost row that has a value.

Jerry gave the answer if there are no blank rows interspersed in the list and the column contains only numbers.

If this is not the case, I don't think there is a one-cell formula but there are ways that use a column and a formula. One way is

B = your list of numbers, empty rows, letters, etc.
C=IF(OR(ISBLANK(B),ISERROR(B/1)),"",ROW()) -> puts row numbers next to numeric values only
Answer =LOOKUP(MAX(C),C,B) ->returns value in the highest marked row

Apr 9, 2011 6:26 AM in response to cloud forest kid

cloud forest kid wrote:
I used to use excel and have switched to Numbers but now I'm kinda' stuck. How can I retrieve the last numeric value in a defined column. In Excel I would do it as:

=VLOOKUP(9.9999999999E+307,K,1)

With excel that gives me the last value in a column. In Numbers this formula renders the highest value of that column.


I'm really not interested by the way VLOOKUP behave in Excel, *_here we are discussing of Numbers_* !

User uploaded file

In cell C2 the formula is :
=IFERROR(IF(ISBLANK(B),0,IF(OR(ISEVEN(B),ISODD(B)),ROW(),0)),0)

Its French version is :
=SI.ERREUR(SI(ESTVIDE(B);0;SI(OU(EST.PAIR(B);EST.IMPAIR(B));LIGNE();0));0)

In D2, the formula is :
=OFFSET($B$1,LARGE(C,1)-1,0)

its French version is :
=DÉCALER($B$1;GRANDE.VALEUR(C;1)-1;0)

Yvan KOENIG (VALLAURIS, France) samedi 9 avril 2011 15:26:19

Sep 1, 2017 6:51 AM in response to cloud forest kid

Use the INDEX formula which looks for an intersection of row and columns You have to say "within this range, look for the crossroads where X happens." It looks for range of cells, row number, column number, and area index. In the example below, it is looking at:


- The range of column D because I only want the highest number in column D

- The row based on COUNTA which is counting cells that have values

- The column 1 because I've only identified a single column (If my range was C:D, I would put 2 to look at D)

- Area index is optional and blank in this case


=INDEX(D2:D21,(COUNTA(D2:D21)),1,area-index)

Sep 1, 2017 11:10 AM in response to MattZic

Hi Matt,


Your formula shares the same weakness as Jerry noted in his initial offering on April 9, 2011.


COUNT(D), used in Jerry's formula, counts only the cells holding numerical values, so the row-offset it generates will be one too small for every cell above the last entry in column D that is empty or that contains a non-numerical value.


COUNTA(D), used in your formula, counts only the cells containing a value, so the row-index it generates will be one too small for every cell above the last entry in column D that is empty.

User uploaded file

Note: These two statements from your post are correct, but not complete:

- The column 1 because I've only identified a single column (If my range was C:D, I would put 2 to look at D)

- Area index is optional and blank in this case


-column-index is needed only when range contains more than one column.

-area-index is needed only when range contains more than one collection of cells.


See the description and usage notes in the Function Browser for details.


The formula shown above is equivalent to yours, but eliminates the unnecessary column and area index arguments.


Badunit's use of an index column and a lookup function solves the issue of empty cells or cells containing non-numeric data in the target column by indexing only the rows containing a number, then returning the value from the row with the greatest index number.


Regards,

Barry

Apr 9, 2011 6:46 AM in response to KOENIG Yvan

Maybe I did not ask the question correctly. Let me try again.

Let's say you have a long column of numbers:
8
2
3
6
9
1
4
3
2
9
2

I'm looking for a formula that will grab the last number in the column. In this case it would be the value "2". I'm not looking for it to give me the highest number in that column, I'm looking for the last number value in the column.

Or to use the example sheet that you posted, what formula could you put in D2 that would report the last number value in column B or in column C?

thanks,

rob

Apr 9, 2011 7:55 AM in response to cloud forest kid

*_If you are unable to read carefully what we post, it will be difficult to help you !_*

What I posted respond to your question.
We can't achieve your goal with a simple formula. An auxiliary column is required.
I described the auxiliary column and the formula using it to get the wanted value.

Yvan KOENIG (VALLAURIS, France) samedi 9 avril 2011 16:55:51

Apr 9, 2011 2:51 PM in response to cloud forest kid

cloud forest kid wrote:
Maybe I did not ask the question correctly. Let me try again.

Let's say you have a long column of numbers:
8
2
3
6
9
1
4
3
2
9
2

I'm looking for a formula that will grab the last number in the column. In this case it would be the value "2". I'm not looking for it to give me the highest number in that column, I'm looking for the last number value in the column.

Rob,

If you don't have any blank rows, and your list starts in row 2 and row 2 is the first body row, you can do something like this, where the last value is reported in the Header Row:

User uploaded file

The formula in the header is:

=OFFSET(A1, COUNT(A), 0)

Since this seems to easy, maybe I have not interpreted your need properly.

Jerry

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Getting Last Numeric Value In Column

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.