Find last non-blank text value

CptnDiego

New Member
Joined
Jan 29, 2018
Messages
3
Column A
Column B
Look For
Result
A
A
A
F
B
B
C
C
D
D
E
E
A
F
B
G
D
H
A
R
I

<tbody>
</tbody>


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

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
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,214,788
Messages
6,121,577
Members
449,039
Latest member
Arbind kumar

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