Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

excel function to find last number in column

Tags:

function

excel

I record the value of my stocks each day in columns and it is a long spreadsheet. In the top cell of each column, I want to use a function that will display the last entry in the column automatically. I've tried the Index function and the Index function combined with the Counta function with no success. Any suggestions?

like image 844
user2259922 Avatar asked Apr 09 '13 02:04

user2259922


People also ask

How do I find the last value in Excel?

Approximate match = last Because during an approximate match Excel scans through values until a value larger than the lookup value is found, then it "steps back" to the previous value. Notice the last argument in VLOOKUP is TRUE for approximate match.


2 Answers

Try using LOOKUP, assuming at most 1000 rows of data (adjust as required) use this formula in A1 to get the last number in A2:A1000

=LOOKUP(9.99E+307,A2:A1000)

You can have blanks or any other data in the range (even errors) and it will still return the last number

like image 72
barry houdini Avatar answered Oct 13 '22 01:10

barry houdini


Try this for Column A, resp. Cell A1:

=OFFSET(A$2;ROWS(A$2:A$101)-COUNTBLANK(A$2:A$101)-1;0)

This example is for a maximum of 100 rows of data (2 - 101). You may replace 101 by any higher number according to the size of your sheet.

Please note that there may be no blank cells in the middle of the list.

like image 1
Jens Fischer Avatar answered Oct 13 '22 00:10

Jens Fischer