Return first non blank result based on lookup value using INDEX or MATCH or LOOKUP

Dan1980

New Member
Joined
Feb 21, 2016
Messages
2
I think I've got a pretty simple one to solve but I can't seem to find the answer within the mrexcel forum.

I want to get the Suburb entries of particular customers.

The INDEX and MATCH combination works well until I get to a blank entry, this is the formula I have been using, simplified for here:



AB
1CustomerSuburb
2John SmithCroydon
3Simon Crouch
4Simon CrouchConcord
5Jane DoeMarrickville
6Sam WhiteParramatta

<tbody>
</tbody>

To get John Smith's Suburb: -

=INDEX(B2:B6,MATCH(A2,A2:A6,0))

=Croydon

As soon as I want to get Simon Crouch's Suburb: -

=INDEX(B2:B6,MATCH(A4,A2:A6,0))

=0

In essence there are thousands of customers, many of which are entered more than once, but there is at least one Suburb entry for each customer.
How do I get excel to display the first non blank Suburb entry for a specific Customer?

Regards,

Dan1980
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
The reason you get 0 is because the 1st match has nothing in column B.

INDEX/MATCH and VLOOKUP always ONLY find the 1st match, then they stop looking.
 
Upvote 0
Marcel, I am curious about your formula. This works perfect for a similar problem I was having. Just curious what 2,1 represents ? I used your formula and instead of looking at B range I was looking at Z range and it still worked perfect. If I am understanding it correctly 2 would reference column B and 1 would reference column A. When I changed the 2 to 26 it still had the same result. I was just making sure I understood your formula correctly. Thanks
 
Upvote 0
Marcel, I am curious about your formula. This works perfect for a similar problem I was having. Just curious what 2,1 represents ? I used your formula and instead of looking at B range I was looking at Z range and it still worked perfect. If I am understanding it correctly 2 would reference column B and 1 would reference column A. When I changed the 2 to 26 it still had the same result. I was just making sure I understood your formula correctly. Thanks

See the excellent explanation provided by Aladin Akyurek at
https://www.mrexcel.com/forum/excel-questions/99621-lookup-value-unsorted-data.html#post492425

M.
 
Upvote 0

Forum statistics

Threads
1,215,794
Messages
6,126,951
Members
449,350
Latest member
Sylvine

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