Return last cell in range

  • Thread starter Thread starter puiuluipui
  • Start date Start date
P

puiuluipui

Hi, i need in "F4" a formula that return the last written cell from "P4:BM4"

Can this be done?
Thanks!
 
Hi,

Lookup what?

Number
=LOOKUP(6.022*10^23,P4:BM4)

text
=LOOKUP(REPT("z",255),P4:BM4)

Mike
 
You can use the following array formula. It will return the value of
the right-most non-blank cell in the range P4:BM4.

=OFFSET(P4,0,MAX(COLUMN(P4:BM4)*(P4:BM4<>""))-COLUMN(P4),1,1)

Since this is an Array Formula, you *must* press CTRL SHIFT ENTER
rather than just ENTER when you first enter the formula
and whenever you edit it later. If you do this properly,
Excel will display the formula in the Formula Bar enclosed
in curly braces { }. (You do not type the curly braces -
Excel includes them automatically.) The formula will not work
properly if you do not use CTRL SHIFT ENTER. See
http://www.cpearson.com/excel/ArrayFormulas.aspx for lots
more information about array formulas.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 
Works Great!
Thanks!

"Chip Pearson" a scris:
You can use the following array formula. It will return the value of
the right-most non-blank cell in the range P4:BM4.

=OFFSET(P4,0,MAX(COLUMN(P4:BM4)*(P4:BM4<>""))-COLUMN(P4),1,1)

Since this is an Array Formula, you *must* press CTRL SHIFT ENTER
rather than just ENTER when you first enter the formula
and whenever you edit it later. If you do this properly,
Excel will display the formula in the Formula Bar enclosed
in curly braces { }. (You do not type the curly braces -
Excel includes them automatically.) The formula will not work
properly if you do not use CTRL SHIFT ENTER. See
http://www.cpearson.com/excel/ArrayFormulas.aspx for lots
more information about array formulas.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Average 2
Zero in Average problem 7
Copying Cell Values 3
Returning last number(time) in a row of cells 4
Help needed 0
Excel VBA 1
How to remove the cell reference in a sheet at once 3
sumproduct 2

Back
Top