VLookup from multi select "Search Value"

=VLOOKUP(Preceptor@row, {VLookUp for Preceptors MCE Name}, 5, false)
Trying to pull one answer from a search value that could have multiple options. Preceptor@row is a multi select drop down, and I only need to pull one value from any of the possible options in the preceptor@row (because it will be the same no matter who gets searched)
The reference sheet is NOT a multi select dropdown (does that make a difference?)
Best Answer
-
Hi,
If you use a multi-select dropdown, SmartSheet gives you the value but adds a new line in between each selected option. This new line is represented by CHAR(10).
So, if we want to find the first selected option in a dropdown, we can do this:
=LEFT([Preceptor]@row, FIND(CHAR(10), [Preceptor]@row))
However, this formula only works if there are at least 2 options selected. If there's only 1 option selected then FIND will be 0, so LEFT will return 0 characters. Let's fix this:
=IF(FIND(CHAR(10), [Preceptor]@row) > 0,
LEFT([Preceptor]@row, FIND(CHAR(10), [Preceptor]@row)),
[Preceptor]@row)This formula checks if there are multiple selected. If there are multiple selected then Find CHAR(10) and return all of the characters to the left (which is the first selected value). If there is only a single selected, then return that value.
Now let's update your VLOOKUP to
=VLOOKUP(
IF(FIND(CHAR(10), [Preceptor]@row) > 0,
LEFT([Preceptor]@row, FIND(CHAR(10), [Preceptor]@row)),
[Preceptor]@row),
{VLookup for Preceptors MCE Name},
5,
false
)This should solve the problem for you!
SSFeatures
Nathan Braun (Founder of SSFeatures) (nathan@ssfeatures.com)
SSFeatures - The browser extension that adds essential features into Smartsheet.
Answers
-
Hi,
If you use a multi-select dropdown, SmartSheet gives you the value but adds a new line in between each selected option. This new line is represented by CHAR(10).
So, if we want to find the first selected option in a dropdown, we can do this:
=LEFT([Preceptor]@row, FIND(CHAR(10), [Preceptor]@row))
However, this formula only works if there are at least 2 options selected. If there's only 1 option selected then FIND will be 0, so LEFT will return 0 characters. Let's fix this:
=IF(FIND(CHAR(10), [Preceptor]@row) > 0,
LEFT([Preceptor]@row, FIND(CHAR(10), [Preceptor]@row)),
[Preceptor]@row)This formula checks if there are multiple selected. If there are multiple selected then Find CHAR(10) and return all of the characters to the left (which is the first selected value). If there is only a single selected, then return that value.
Now let's update your VLOOKUP to
=VLOOKUP(
IF(FIND(CHAR(10), [Preceptor]@row) > 0,
LEFT([Preceptor]@row, FIND(CHAR(10), [Preceptor]@row)),
[Preceptor]@row),
{VLookup for Preceptors MCE Name},
5,
false
)This should solve the problem for you!
SSFeatures
Nathan Braun (Founder of SSFeatures) (nathan@ssfeatures.com)
SSFeatures - The browser extension that adds essential features into Smartsheet.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 66.2K Get Help
- 431 Global Discussions
- 152 Industry Talk
- 490 Announcements
- 5.2K Ideas & Feature Requests
- 85 Brandfolder
- 155 Just for fun
- 74 Community Job Board
- 501 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 306 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!