Lookup & Indirect to Find Last Non Blank

anderb16

New Member
Joined
Nov 17, 2014
Messages
12
Hello,

I have data like this:


ColorShape
OneCircle
TwoRed
ThreeSquare
TwoThree

What I'm doing is returning the value in column A in the last non blank row in column B regardless of the value.

Currently, in cell B5, I am using =LOOKUP(2,1/($B$2:$B$4<>""),$A$2:$A4) which correctly gives me "Two."

I have multiple individuals using this spreadsheet, manipulating data as they need and they frequently break the formula.

What I tried:

In Cell B5 =LOOKUP(2,1/(INDIRECT(ADDRESS(2,COLUMN())&":"&ADDRESS(ROW()-1,COLUMN()))<>""),INDIRECT(ADDRESS(2,1)&":"&ADDRESS(ROW()-1,1)))
Which gives me an #N/A result

However, using:
In cell B5 =LOOKUP(2,1/(INDIRECT(B6)<>""),INDIRECT(ADDRESS(2,1)&":"&ADDRESS(ROW()-1,1)))
With a helper in B6 =ADDRESS(2,COLUMN())&":"&ADDRESS(ROW()-2,COLUMN())
Provides the correct answer.

Is it possible to do this without the helper?

Thanks!
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
74,384
Office Version
  1. 365
Platform
  1. Windows
You're formula works for me, but how about
Excel Formula:
=LOOKUP(2,1/(B$2:INDEX(B:B,ROW()-1)<>""),A$2:INDEX(A:A,ROW()-1))
 
Master Excel Bundle

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.

Forum statistics

Threads
1,167,136
Messages
5,852,350
Members
431,497
Latest member
SteelheadBen

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Top