Return data to the left based on next blank cell

dannywhite

New Member
Hi All,
Im sure there is an easy way to do this, after a fair bit of googling nothing seems to be fit what i am after hence the post.

I have weekly incremental data been entered into rows, i would like to return the last entry into another cell.

E.g

my formula would be in A1
the data
B1, C1, D1, E1 etc
this would grow
therefore i would like a formula to return the last value entered, the above case it would be E1, as the dataset grows i want A1 to automatically take the last entered value.

i was thinking of somehow searching the next blank cell and return the value to the left as a solution?

Welcome anyone help.

Cheers
Danny

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

skywriter

Well-known Member
Hi Danny,

You could try this formula in A1, it will get you to row A1000.
I'm not a big formula guy, I like writing code, but it works and maybe by posting this one of the formula gurus will come along and post something more efficient.
Code:
``=OFFSET(\$A\$2,COUNTA(\$A\$2:\$A\$1000)-1,0)``

Good Luck

Last edited:

FlameRetired

Active Member
Another approach.

Code:
``=LOOKUP(2,1/(B1:ZZ1<>""),B1:ZZ1)``
Just be sure to use a suitably large enough column reference to include future data and minimize the need for future editing. Try to avoid the temptation to reference whole rows though.

skywriter

Well-known Member
Thanks Dave,

I guess I've got foggy head today.

Somehow I interpreted C1, D1 etc as going down column A.

FlameRetired

Active Member

Been there done that. Maybe something to do with the week-end. LOL

MandeepBaluja

Board Regular
=index(b1:zz1,counta(b1:zz1))

Peter_SSs

MrExcel MVP, Moderator
=index(b1:zz1,counta(b1:zz1))
I'd say that is somewhat risky as any empty cells among the data will cause it to return an incorrect result without warning.

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,163,990
Messages
5,834,746
Members
430,315
Latest member
bobh63

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back