Mrrrr's Forum
Lista Forumurilor Pe Tematici
Mrrrr's Forum | Lista de useri | Inregistrare | Login

POZE MRRRR'S FORUM

Nu sunteti logat.
Nou pe simpatie:
bruneta_ta_us
Femeie
25 ani
Giurgiu
cauta Barbat
25 - 50 ani
Mrrrr's Forum / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [EXCEL] Get Value of Last Non Empty Cell in Row [LOOKUP] Moderat de TonyTzu  
Autor
Mesaj Pagini: 1
TRaP
Membru activ

Inregistrat: acum 1 an
Postari: 308
Source:
https://exceljet.net/formula/get-value- ... empty-cell

=LOOKUP(2;1/(A:A<>"");A:A)

It does not have to be an entire column, you can make the formula like:

=LOOKUP(2;1/(D2:D30<>"");D2:D30)


pus acum 1 luna
   
TRaP
Membru activ

Inregistrat: acum 1 an
Postari: 308
Same source as above, all credit to them.

Dealing with errors

If there are errors in the lookup_vector, particularly if there is an error in the last non-empty cell, this formula needs to be adjusted. This adjustment is needed because <>"" criteria will return an error itself if a cell contains an error. To workaround this problem, use ISBLANK with NOT:

=LOOKUP(2;1/(NOT(ISBLANK(A:A)));A:A)

Last numeric value

To get the last numeric value, you can add the ISNUMBER function like this:

=LOOKUP(2;1/(ISNUMBER(A1:A100));A1:A100)

Position of the last value

If you want to get the position (in this case row number) of the last value, you can try a formula like this:

=LOOKUP(2;1/(A:A<>"");ROW(A:A))

Here we feed the row numbers of the same range into lookup for the result vector and get back the row number of the last match.


pus acum 1 luna
   
Pagini: 1    
Mergi la