Counting selected dropdown elements with Collect function?!?
Hey all, first time caller, long time listener.
I have a sheet (Sheet 1) that has a drop down column, the user can select any or all of 26 elements. In the same sheet I have a column titled agents with 15 agents in a drop down multiselect cell. This sheet has over 900 rows on data.
In a metric sheet (where I am aggregating the data), I have one of the 15 agent names in a cell (Agent James Bond), then another column with the 26 elements (lets just assume ROBOT, MONKEY, BUTLER and so on) expanded into individual cells downward. I would like to get the count if any of the items are selected, with the corresponding agent.
I tried =COUNTM(COLLECT({26Elements}, {Agents}, @cell = Agent@row, FIND("Robot", @cell), 0))
But alas, it is not correct. I have wrecked my brain on this logic for a while now, and believe I am missing something easy, or I am over complicating things here.
Any thoughts?
Best Answer
-
You would use a COUNTIFS with a HAS function.
=COUNTIFS({Agents}, HAS(@cell, Agent@row), {Elements}, HAS(@cell, "Robot"))
Answers
-
You would use a COUNTIFS with a HAS function.
=COUNTIFS({Agents}, HAS(@cell, Agent@row), {Elements}, HAS(@cell, "Robot"))
-
Thank you Paul, I had not thought about a double HAS to solve this. Can't believe I had not thought of that.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 67.1K Get Help
- 448 Global Discussions
- 154 Industry Talk
- 504 Announcements
- 5.4K Ideas & Feature Requests
- 85 Brandfolder
- 156 Just for fun
- 80 Community Job Board
- 512 Show & Tell
- 34 Member Spotlight
- 2 SmartStories
- 308 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!