Need an Formula to generate Categories column
We are looking for the Categories to auto generate from the sub-categories multi dropdown selection. We were achieved this by using the =IF(COUNTIF([Sub-Categories]@row, CONTAINS("Fruits", @cell)) >= 1, "Fruits") + CHAR(10) + IF(COUNTIF([Sub-Categories]@row, CONTAINS("Meats", @cell)) >= 1, "Meats") + CHAR(10) + IF(COUNTIF([Sub-Categories]@row, CONTAINS("Vegetables", @cell)) >= 1, "Vegetables") but it is not dynamic, we should not define the search text here like "Fruits". We are looking extract first text of each dropdown selection (Non-duplicate) -> (i.e., Fruits/Meats/Vegetables) - under categories. Could you please help me out here?
Answers
-
This type of approach allows for flexibility of categories; however, it would need modification for the multi-select aspect. Will revisit as able later today....
=IFERROR(LEFT([Sub-Categories]@row, FIND("-", [Sub-Categories]@row) - 1), "")
Hope this helps!
-
@Kelly P. Thanks for the quick response, your formula works only for the first selection, I need to extract all First words from each selection.
-
I would suggest creating a table that has all subcategories in one column and the corresponding category in another. Then you can use a JOIN/COLLECT combo to pull in the appropriate categories. The table can be on a separate sheet and the formula would have cross sheet references for ranges, but here's a quick example.
=JOIN(DISTINCT(COLLECT([Category (Table)]:[Category (Table)], [Subcategory (Table)]:[Subcategory (Table)], HAS([Sub-categories]@row, @cell))), CHAR(10))
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 142 Just for fun
- 58 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!