Using Vlookup where search value contains multiple values (column is a drop down)
I have a main sheet where i want to select "Plants for Consideration", then after selecting a production plant the emails of the people involved will populate in another cell.
I've created a separate smartsheet to reference which has the column on the far left "Plants for Consideration" and then in another column (column 11) i have all of the emails of the personnel i would need to reach out to.
This is the formula:
=IFERROR(VLOOKUP([Plants for Consideration]@row, {Temp Plant Contact Details_6-17-2024 Range 1}, 11, true), "")
The problem being, the "Plants for Consideration" column in the main sheet has multiple options. I want to be able to select multiple plants and have all of the emails be referenced.
Is this possible?
Thank you in advance,
Best Answers
-
You can use HAS for this:
=JOIN(COLLECT({Emails}, {Plants}, HAS([Plants for Consideration]@row, @cell)), ";")
Where {Emails} is a cross-sheet reference for the Plant Contact Email(s) column, and {Plants} is a cross-sheet reference for the Plants for Consideration column.
Basically this does a "reverse lookup". The formula runs like this:
- COLLECT looks at each row of your reference sheet, in the Plants for Consideration column
- HAS says "ok - for the Plants for Consideration cell that I'm on in the reference sheet (this is the @cell part), does it show the same word as one of the selections in the Plants for Consideration cell on my row in the first sheet?" HAS specifically is used when you have a multiple-selection dropdown list that you're trying to match to…it will match if any of the selections match.
- If the plant name on the reference sheet matches any of the plant names selected on the first sheet, COLLECT will pick up the email addresses from that row on the reference sheet and add them to a temporary array (a list).
- COLLECT then moves on to the next reference sheet row and repeats the process, all the way down the sheet.
- JOIN then takes all the emails that COLLECT has "collected", and separates them with a ; and then posts them into the contacts cell on the first sheet.
-
Couple of ways depending on what you want.
For super basic you can use DISTINCT
= JOIN (DISTINCT (range), ";" )
If you have other criteria you want to use to determine what to join, you can use JOIN(COLLECT for that. COLLECT is useful in a lot of ways :-).
= JOIN ( COLLECT ( range, range , <>"", range 2, criteria2 ), ";" )
Answers
-
You can use HAS for this:
=JOIN(COLLECT({Emails}, {Plants}, HAS([Plants for Consideration]@row, @cell)), ";")
Where {Emails} is a cross-sheet reference for the Plant Contact Email(s) column, and {Plants} is a cross-sheet reference for the Plants for Consideration column.
Basically this does a "reverse lookup". The formula runs like this:
- COLLECT looks at each row of your reference sheet, in the Plants for Consideration column
- HAS says "ok - for the Plants for Consideration cell that I'm on in the reference sheet (this is the @cell part), does it show the same word as one of the selections in the Plants for Consideration cell on my row in the first sheet?" HAS specifically is used when you have a multiple-selection dropdown list that you're trying to match to…it will match if any of the selections match.
- If the plant name on the reference sheet matches any of the plant names selected on the first sheet, COLLECT will pick up the email addresses from that row on the reference sheet and add them to a temporary array (a list).
- COLLECT then moves on to the next reference sheet row and repeats the process, all the way down the sheet.
- JOIN then takes all the emails that COLLECT has "collected", and separates them with a ; and then posts them into the contacts cell on the first sheet.
-
Wow, that worked. Thank you for such a quick reply. That is exactly what i was looking for!
-
You're welcome!
-
on a somewhat similar topic. when it comes to just joining a number of emails into a single text column, but i have a couple columns that are blank.
is there some way i can modify the join() function.
I just want all the emails to be in a text list with a ";" delimiter between them and remove blanks.
-
Couple of ways depending on what you want.
For super basic you can use DISTINCT
= JOIN (DISTINCT (range), ";" )
If you have other criteria you want to use to determine what to join, you can use JOIN(COLLECT for that. COLLECT is useful in a lot of ways :-).
= JOIN ( COLLECT ( range, range , <>"", range 2, criteria2 ), ";" )
-
Hi Bryan,
I've learned recently that the automation functionality does not work when you have cells with multiple emails joined together. Are there any work around for getting smartsheet to recognize them? Once i have all the emails, i wanted to send an automated email to that list of emails for approval.
Combine Contacts from multiple columns into a single cell - Page 4 — Smartsheet Community
-
@Dallas G see my article below
https://community.smartsheet.com/discussion/123433/combine-emails-into-a-multiple-contact-column-multi-contact-column#latest
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.3K Get Help
- 423 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 144 Just for fun
- 59 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!