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:



[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Customer[/TD]
[TD]Suburb[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]John Smith[/TD]
[TD]Croydon[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Simon Crouch[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Simon Crouch[/TD]
[TD]Concord[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Jane Doe[/TD]
[TD]Marrickville[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Sam White[/TD]
[TD]Parramatta[/TD]
[/TR]
</tbody>[/TABLE]

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

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
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,223,099
Messages
6,170,107
Members
452,302
Latest member
TaMere

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