VLOOKUP with multiple results RETURNS text if multiple return values...? No vba...

heathclif

Board Regular
Joined
Jun 12, 2015
Messages
83
:eeek: Possible?

Trying to get a non-vba solution to have a vlookup return the word "MULTI" if there are multiple RETURN values for a lookup values. Example:


[TABLE="width: 466"]
<tbody>[TR]
[TD][TABLE="width: 466"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD]lookup values[/TD]
[TD][/TD]
[TD]Array[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD]Holga[/TD]
[TD][/TD]
[TD]小非[/TD]
[TD="align: right"]9854[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD]Doña[/TD]
[TD="align: right"]3023[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD][/TD]
[TD][/TD]
[TD]Doña[/TD]
[TD="align: right"]3023[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD]Holga[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD][/TD]
[TD][/TD]
[TD]Holga[/TD]
[TD="align: right"]382983724[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]=VLOOKUP(A2,C:D,2,FALSE)[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

(!) Notice the difference between Doña and Holga. Doña has identical return values and Holga has different return values. The solution should return the text "MULTI" for Holga, but should NOT return "MULTI" for Doña (it should return '3023').

Or does anyone have a more elegant solution? Keep in the mind the dataset spans several hundred thousand lines so needs to consider resources for scale up. Many thanks in advance. :rofl: :rofl:
 
Last edited:

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
This seems like an odd request (doable though)

Is there going to be more after this?
Like, of the ones that return Multi, can we list each of the items (for Holga would be 2 and 382983724) ?
 
Upvote 0
That would be great to we list each of the items! But return values would have to inhabit the same cell (ie. '2' and '382983724' would have to inhabit the same cell: 2, 382983724). Possible:confused:
 
Last edited:
Upvote 0
I think that's going to be above me..

Why the objection to VBA, it would be pretty simple that way.
 
Upvote 0
Hmmm. Hence, trying to keep it simple and return "MULTI" ...

The dataset is complicated involving pivots etc...
 
Upvote 0
OK, so it's NOT an objective to list each of the multi results?
You only want to identify which ones have multiple ?
 
Upvote 0
Try

=IF(COUNTIF(C:C,A2)=COUNTIFS(C:C,A2,D:D,VLOOKUP(A2,C:D,2,FALSE)),VLOOKUP(A2,C:D,2,FALSE),"Multi")
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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