Vlookup with multiple results

Itsweaver

New Member
Joined
Dec 22, 2017
Messages
2
Morning all,

Hopefully someone will be able to let me know if this is possible.

I am currently trying to create a Vlookup that has a possibility of multiple results. The cell it returns could be one of a few. Vlookup normally brings back the first result which is normally fine.

I would like a formula the would let me know if there are multiple different results but would also bring through an answer if all the possible results are the same.

Eg -

A B
1 1
2 1
1 2
1 1
1 2

If i do a vlookup on the above asking to look in column A for 1s i would like a message "multiple results" but if i was looking for 2s it would give me "1".

Hope that makes sense. I have done many searches but can not find anything like this.

Is it possible?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Morning all,

Hopefully someone will be able to let me know if this is possible.

I am currently trying to create a Vlookup that has a possibility of multiple results. The cell it returns could be one of a few. Vlookup normally brings back the first result which is normally fine.

I would like a formula the would let me know if there are multiple different results but would also bring through an answer if all the possible results are the same.

Eg -

A B
1 1
2 1
1 2
1 1
1 2

If i do a vlookup on the above asking to look in column A for 1s i would like a message "multiple results" but if i was looking for 2s it would give me "1".

Hope that makes sense. I have done many searches but can not find anything like this.

Is it possible?


Does it need to be specifically a vlookup?

You could use conditional formatting to identify duplicates and highlight them instead.

Select range,

Click conditional formatting on the home menu, choose highlight cell rules, then click duplicate values.

Vlookup will only return the value of the first instance it finds, so furthermore from your example, it would never find 1 2 if the lookup criterea was 1 as it would stop after finding 1 1.


Regards,

Dan.
 
Last edited:
Upvote 0
You could use countif to test for multiple results

=IF(COUNTIF($A$2:$A$10, 1)>1, "Multiple Results", VLOOKUP(1, $A$2:$B$10, 2, 0))
 
Upvote 0
I would like a formula the would let me know if there are multiple different results but would also bring through an answer if all the possible results are the same.

Hi, welcome to the board!

Here is one possible option..


Excel 2013/2016
ABCDE
1ABLookupFormula
2111Multiple
32121
41234
511
612
734
834
934
Sheet1
Cell Formulas
RangeFormula
E2=IF(COUNTIFS($A$2:$A$9,D2)=COUNTIFS($A$2:$A$9,D2,$B$2:$B$9,VLOOKUP(D2,$A$2:$B$9,2,0)),VLOOKUP(D2,$A$2:$B$9,2,0),"Multiple")
 
Upvote 0
Hi, welcome to the board!

Here is one possible option..

Excel 2013/2016
ABCDE
1ABLookupFormula
2111Multiple
32121
41234
511
612
734
834
934

<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
E2=IF(COUNTIFS($A$2:$A$9,D2)=COUNTIFS($A$2:$A$9,D2,$B$2:$B$9,VLOOKUP(D2,$A$2:$B$9,2,0)),VLOOKUP(D2,$A$2:$B$9,2,0),"Multiple")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

This has done the job perfectly! you have saved me many hours of pain.

Thank you !
 
Upvote 0

Forum statistics

Threads
1,215,124
Messages
6,123,187
Members
449,090
Latest member
bes000

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