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

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
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))
 
Upvote 0

Forum statistics

Threads
1,223,098
Messages
6,170,100
Members
452,301
Latest member
QualityAssurance

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
Back
Top