Is there a work around for trying to use CONTAINS() or HAS() within collect()?
I am trying to summarize my projects data that is assigned to a work type, dates/weeks specifically and then count it by week or singe day. Can't figure it out.
I have a summary sheet that brings in a multi select column (I have also tried it just text) off all the dates each work type has work. I am then on a separate sheet for each date trying to count the number of times each one of the columns has a date within it.
Best Answer
-
Hey @Greg F
Little bit confused on what you are trying to do. Looks like you want to count the number of times a date appears on the Summary Sheet for a specific Work Type and display that count on the Count Sheet. If that is what you are looking for something like the formula below could work for you.
This is the formula without the references.
=COUNT(COLLECT([Software Engineer]:[Software Engineer], [Software Engineer]:[Software Engineer], HAS(@cell, [Date of Work]@row)))
Replaced with references would look something like this.
=COUNT(COLLECT({Ref 1:[Software Engineer]:[Software Engineer]}, {Ref 1:[Software Engineer]:[Software Engineer]}, HAS(@cell, [Date of Work]@row)))
Answers
-
I can get it to tell me if a single project has a work type on a given day but not if multiple are using
=IF(CONTAINS([Date Column]@row, COLLECT({Work Type}, {Work Type}, <>"", {Work Type}, <>"First Row")), 1, 0)
-
Hey @Greg F
Little bit confused on what you are trying to do. Looks like you want to count the number of times a date appears on the Summary Sheet for a specific Work Type and display that count on the Count Sheet. If that is what you are looking for something like the formula below could work for you.
This is the formula without the references.
=COUNT(COLLECT([Software Engineer]:[Software Engineer], [Software Engineer]:[Software Engineer], HAS(@cell, [Date of Work]@row)))
Replaced with references would look something like this.
=COUNT(COLLECT({Ref 1:[Software Engineer]:[Software Engineer]}, {Ref 1:[Software Engineer]:[Software Engineer]}, HAS(@cell, [Date of Work]@row)))
-
Thank you! This worked!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.6K Get Help
- 433 Global Discussions
- 136 Industry Talk
- 465 Announcements
- 4.9K Ideas & Feature Requests
- 143 Brandfolder
- 147 Just for fun
- 63 Community Job Board
- 466 Show & Tell
- 32 Member Spotlight
- 2 SmartStories
- 298 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!