- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 17, 2023 07:09 PM
Hi there,
I am trying to attempt to add a formula, that when a certain hotel name is entered in column A, then in column B, depending on that hotel name, it adds the hotel brand automatically. For example:
If Hotel Name is Hyatt Centric, then Hotel Brand is Hyatt. I can get this formula to work:
But my question is can I/how do I have multiple Hotel Names in one hotel brand? For example:
If hotel name is Hyatt Centric, Hyatt House, Hyatt Place or Hyatt Regency in column A, then Hotel Brand is Hyatt in column B.
How do I write the switch formula to have multiple options?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 17, 2023 08:52 PM
Hi @TRBS, what you're trying to do is certainly achievable in Airtable with the switch operator. Your formula isn't working because it's incomplete (linking the support page for detailed information).
Essentially, a successful switch formula will include:
- the field to reference
- a list of patterns (in this case, the patterns will be the hotel names)
- the corresponding result for each pattern (the hotel brands)
- a default result if none of the patterns are matched
The formula, then, would look like this:
SWITCH(
{Column A/Hotel Name},
"Hyatt Centric", "Hyatt",
"Hyatt House", "Hyatt",
"Hyatt Place", "Hyatt",
"Sheraton Grand Los Angeles", "Marriot",
"Sheraton Universal", "Marriot",
BLANK()
)
Each of the patterns (hotel names) have a corresponding result (brand), and if a pattern isn't recognized, the value will default to blank (that's what that "BLANK()" is doing at the end). Just keep adding patterns and results in the "pattern, result," grouping and you should be all set. Let me know if that works!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 18, 2023 03:29 PM
Hi! I think I am missing something - still getting an error:
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 18, 2023 04:00 PM
Hi @TRBS, the error is due to the IHG hotel names being duplicates of Hilton hotels. The pattern:result ration has to be 1:1, otherwise the formula doesn't know which one to resolve to. Also looks like a comma was missing after "HUALUXX Hotels and Resorts", "IHG", but the formula won't work until the duplicate issue is resolved. Hope this helps!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 18, 2023 06:00 PM
Is there a hotel table?
In this case, I would like to create a hotel table and create a select field for the brand and reference that in lookup.
This formula is difficult to manage
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 28, 2023 11:36 AM
Thank you @CJSmith ! That worked - I had been staring at it too long and didn't see that.
