How do I return last cell from a row of data?

S

Sam

I'm wanting to do a fairly simple calculation that needs to use the last
cell in a row of data, that is the last cell with data.

I can use COUNT to find out how many cells have data, but I don't know how
to specify a cell address that defines a base cell then the offset of the
count.

Is there a formula such as LAST that will return the last value in a range
of cells in a row?

Or is there a way of specifying an address where I give a starting row
number then a cell with the offset, or perhaps specify the row as a
calculation?

Any help would be greatly appreciated.

Sam
 
J

Jason Morin

If the data is continuous (ie no empty cells in between
the data), then use this (assumes row 1):

=OFFSET(A1,,COUNTA(1:1)-1)

If there are breaks in the data (eg A1, B1, D1 contain
data), then use:

=INDEX(1:1,MAX(IF(1:1<>"",COLUMN(1:1))))

The 2nd formula is an array formula, so you must press
ctrl/shift/enter, not enter, for it to work. Excel will
place {} around it.

HTH
Jason
Atlanta, GA
 
S

Sam

Thanks, Jason, for your helpful reply to my question.

I'll give it a go today.

regards
Sam
-----
 

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

Top