Suggestion for returning data based on selected criteria
I'm looking for some guidance. I would like a cell to return text (category) based on selected criteria (sub category) -- screen shots below.
Example: If I select 'Wine' from the drop down, I would like the Category cell to return 'Food & Bev'.
I could do an IF statement, however, there are several subcategories in the drop down as well as several categories so I was hoping I was overlooking some kind of VLookup or something easier that could search a range for the categories to return a category. Hopefully that makes sense, any thoughts would be appreciated!!
Best Answer
-
You could set up a table such as below (column headers in bold).
Table Sub Cat Table Cat
Wine Food & Bev
Cheese Food & Bev
Table Cloth Material
so on and so forth...........
In the Category column, you would use a formula such as this:
=INDEX([Table Cat]:[Table Cat], MATCH([Sub Category]@row, [Table Sub Cat]:[Table Sub Cat], 0))
What this will do is look at the Sub Category column and pull the appropriate category from the Table Cat column.
Using a table instead of the nested IF's allows a lot more flexibility to edit, remove, or add to the table as needed without having to open and edit a long, complex formula.
Answers
-
You could set up a table such as below (column headers in bold).
Table Sub Cat Table Cat
Wine Food & Bev
Cheese Food & Bev
Table Cloth Material
so on and so forth...........
In the Category column, you would use a formula such as this:
=INDEX([Table Cat]:[Table Cat], MATCH([Sub Category]@row, [Table Sub Cat]:[Table Sub Cat], 0))
What this will do is look at the Sub Category column and pull the appropriate category from the Table Cat column.
Using a table instead of the nested IF's allows a lot more flexibility to edit, remove, or add to the table as needed without having to open and edit a long, complex formula.
-
Omg, Paul you are awesome!! Thank you so much, that worked perfectly!
-
Happy to help! 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 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!