Find last non-blank text value

CptnDiego

New Member
Joined
Jan 29, 2018
Messages
3
[TABLE="width: 400"]
<tbody>[TR]
[TD]Column A
[/TD]
[TD]Column B
[/TD]
[TD]Look For
[/TD]
[TD]Result
[/TD]
[/TR]
[TR]
[TD]A
[/TD]
[TD]A
[/TD]
[TD]A
[/TD]
[TD]F
[/TD]
[/TR]
[TR]
[TD]B
[/TD]
[TD]B
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C
[/TD]
[TD]C
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]D
[/TD]
[TD]D
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]E
[/TD]
[TD]E
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A
[/TD]
[TD]F
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]B
[/TD]
[TD]G
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]D
[/TD]
[TD]H
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]R
[/TD]
[TD]I
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Hiall,

I need Excel to look for a specific text in column 'A' and return thelast non-blank corresponding value in column 'B'. I know how to achievethis this when values in column 'B' are numeric via the lookup function. However,I have not found a way to do it when column 'B' is text.

In the table below above, when I search for 'A', I would likethe result to be 'F' (the last non-blank result). As you can see,I can achieve this when column B contains only numericvalues but not when they are text.

*I usethe following formula if column B contains only numeric values:{=LOOKUP(9,99999999999999E+307;IF($I$3:$I$13=$L$3;IF(($J$3:$J$13)<>0;$J$3:$J$13)))}

Any insight or idea on how to do this for text entries is appreciated.

Have a great day,
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
This should work:

=LOOKUP(2,1/(($A$1:$A$10=C1)*($B$1:$B$10<>"")),$B$1:$B$10)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,173
Members
453,021
Latest member
Justyna P

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