VLOOKUP not working when there is more than one entry of the same value

dominiquebk

New Member
Joined
Apr 9, 2024
Messages
7
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hiya,

I am using VLOOKUP to pull day rates into a sheet - this is against a set of pre-defined role codes.

My formula is the following: =VLOOKUP($D10,Rates!B3:D26,3,FALSE)

I am facing an issue with the formula not working when two or more of the same role code are used.

How do I fix the issue?
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
What do you want it to do when there are multiple matching values?

If you want to return all of them, the easiest way is to use the new FILTER function, available in Excel 2021 and 365.
See: FILTER function - Microsoft Support
 
Upvote 0
So:

So the user selects the 'role' code from a predefined drop down list, the rate column should then populate with the appropriate 'rate' defined in another sheet. This is all i want it to do.

However, when I select a duplicate role code (see other picture), it errors. It doesn't always do this. For example, when i select another DR1, it doent give me an error.

Does that make sense?
 

Attachments

  • 1716225969839.png
    1716225969839.png
    7.9 KB · Views: 13
  • 1716226129729.png
    1716226129729.png
    7.9 KB · Views: 13
Upvote 0
Looks like you may need to make it a fixed reference. Does adding $ signs to all those formulas help?
Excel Formula:
=VLOOKUP($D10,Rates!$B$3:$D$26,3,FALSE)
 
Upvote 0
Solution
Looks like you may need to make it a fixed reference. Does adding $ signs to all those formulas help?
Excel Formula:
=VLOOKUP($D10,Rates!$B$3:$D$26,3,FALSE)
That's worked! Thank you so much.

Just so I know for next time, what exactly does this mean - making it a fixed reference?
 
Upvote 0
That's worked! Thank you so much.

Just so I know for next time, what exactly does this mean - making it a fixed reference?
If you do not lock it, when you copy it down, your lookup range will shift down one row each time, i.e.
Rich (BB code):
=VLOOKUP($D10,Rates!B3:D26,3,FALSE)
when copied down one row will change to:
Rich (BB code):
=VLOOKUP($D10,Rates!B4:D27,3,FALSE)

Notice how your lookup range is moving down. You want to lock it in place.
Adding a "$" in front of a column or row reference will lock that in place as you copy a formula to another range.
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

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