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
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 140 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!