Highlight duplicate values with a criteria within multiple select column
Hello
I have this system where workers report with a form their done tasks and locations for those specific tasks. I am trying to avoid the option for them to do duplicate inputs.
It works like this: worker chooses a task in form cell, then the locations where he did that task. They do multiple locations per form input, up to 20 or so, that is why the location is a multiple drop down list. Total list of locations is ca 1000. If one of those locations is reported for that specific task, then it is 100% completed and SHOULD NOT be reported again, however that happens, due to human error and so.
That is why I trying to come up with a helper column with some formula where it is highlighted that work for this location and this specific task there has already been reported.
表单输入的例子是这样的:新ry is added as the top row, leftmost column is is the Locations (a, b, c etc.) with multi select column, middle column is the Task ID, and rightmost column is where duplicates are highlighted.
My goal is so that in the right column the Red flag appears automatically to highlight that a location of row number 3 has already been reported in row number 5 for that specific task, same with row number 6 and 8. In this example I have marked the flag manually.
I figured I could make something with COUNTIFS to first count all locations with specific criteria of the task and compare it within the task ID, but I could not get it to work.
Link to the sheet, feel free to modify it:https://app.smartsheet.com/b/publish?EQBCT=47d9ee0c958d43b4884212959f1cba25
I would really appreciate some anybody has some ideas on how to proceed.
Thank you
Answers
-
Paul Newcome ✭✭✭✭✭✭
-
Sander K ✭✭✭✭
33 Tasks
-
Paul Newcome ✭✭✭✭✭✭
Ok. I have a couple of ideas, but will need to do some testing first. I'll get back to you with what I find out.
-
Paul Newcome ✭✭✭✭✭✭
你会开放tracki不同的方法吗ng duplicates? Such as listing out which tasks (if any) were duplicated for each location?
-
Sander K ✭✭✭✭
hmmmm, not exactly. But I created now a separate file where I have a table:
Here I have ca 1000 rows with locations and 33 columns tasks. In the cells where are "OK", "Double" and "1" are nested IF formulas, which highlight if for that task and that location there is a duplicate reported.
=IF(COUNTIFS({range}, task1, {range}, CONTAINS($[Location]908, @cell)) > 0, IF(COUNTIFS({range}, task1, {range}, CONTAINS($[Location]908, @cell)) > 1, "DOUBLE", "OK"), 1)
-
Paul Newcome ✭✭✭✭✭✭
Yes. That is basically where I started as well. I built out the same table with a row for each location and a task for each column then used COUNTIFS to pull the count.
The only difference is that you used the IF's to populate "OK", "Double", or "1" directly in the grid based on the count, and I used a JOIN/COLLECT to pull a list into a separate field based on the counts. So you had the same basic idea as I did. Hahaha
One thing I would suggest... Enter the text for each task in row 1 across the top of your table and use cell references instead of specific text in your formulas. This will allow you to use an even more generic COUNTIFS that can be dragfilled both down the rows and across the columns. It also means that if you need to adjust the text of the task name, you can adjust it once in the cell in row 1 instead of adjusting it twice in the formula and having to dragfill again.
-
Leibel S ✭✭✭✭✭✭
Here is a solution, but requires a few extra columns...
- LINE-ID: SYSTEM AUTO NUMBER
- ROW#: =MATCH([Row ID]@row, [Row ID]:[Row ID], 0
- Collect Location: (multi select column) =JOIN(COLLECT(Location:Location, [Task ID]:[Task ID], [Task ID]@row, [ROW#]:[ROW#], <=[ROW#]@row), CHAR(10))
- Location Count: =COUNTM(Location@row)
Your duplicate flag formula would then be:
=IF(SUMIFS([Location Count]:[Location Count], [Task ID]:[Task ID], [Task ID]@row, [ROW#]:[ROW#], <=[ROW#]@row) > COUNTM([Collect Location]@row), 1, 0)
Let me know if you need help with the details.
-
Paul Newcome ✭✭✭✭✭✭
@Leibel SI'm having a little trouble following how this works... If I select Location A and Task 1 then later Location A and Task 2, wouldn't this setup flag it as duplicates even though it is a different task for that location?
-
Leibel S ✭✭✭✭✭✭
I made a slight edit to the above comment to clarify thatCollect Locationshould be amulti select column.
The basic premise is that incollect locationwe pull in all the locations that have been associated with this task (including the current row). Because it is amulti select columnit automaticallyremoves duplicates.
Location count is the qty of locations for that specific row
If I sum up the location count for this task till and including the current row it will give me the total qty of locations specified for this task (till an including this row).
If that number is more then the count of locations in 'collect location', that means that collect location removed a duplicate and that you have a duplicate on your row.
-
Paul Newcome ✭✭✭✭✭✭
@Leibel SAh. Ok. Changing it to the multi-select did the trick. That was the part I was missing.
Side note: This solution will not flag the first occurrence. So using the screenshot in the original post it would only flag rows 5 and 8. To get it to flag all rows that have the duplicate including the first occurrence (as shown in the original screenshot), you would only have to remove all references to the row #.
-
Leibel S ✭✭✭✭✭✭
Good point. That also simplifies it...
-
Paul Newcome ✭✭✭✭✭✭
@Leibel SI do like the idea of using an additional Multi-Select column to filter out duplicates. I am going to have to remember that little trick. I hadn't thought of it before. Now I need to try to find some of the other posts that I have commented on where we parsed the options out in helper columns to see if this solution can be adapted.
-
Sander K ✭✭✭✭
@Paul Newcomeand@Leibel SThank you very much for your help, I got it working nicely. However, right now when new input is reported and it is a duplicate to some of the previous ones, then the previous one is highlighted, not the new one. How could I make it the opposite way?
-
Paul Newcome ✭✭✭✭✭✭
If you remove the references to the row number from the formulas, it will highlight all duplicates including the first occurrence.
If your new entries are at the top of the sheet and you only wanted to flag the duplicates excluding the first entry, then you could swap the row references from "less than or equal to" to "greater than or equal to".
Help Article Resources
Categories
Check out theFormula Handbook template!
Give this a try.<\/p>
=SUMIFS({Broker Report Test 2 Range 1}, {Broker Activity Report Range 6}, \"January\", {Broker Activity Report Range 1}, OR(@cell = \"EMORY DECATUR I\",@cell = \"EMORY DECATUR II\",@cell = \"EMORY DECATUR III\"))<\/p>
Hope this helps,<\/p>
Dave<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]},{"discussionID":111186,"type":"question","name":"Dividing to Create a %","excerpt":"I would like to use the data in Column A and B to create a percentage complete by row NOT by parent\/hierarchy. In Excel this would be =sum(Column B\/Column A) = %. What is the formula for Smartsheet?","snippet":"I would like to use the data in Column A and B to create a percentage complete by row NOT by parent\/hierarchy. In Excel this would be =sum(Column B\/Column A) = %. What is the…","categoryID":322,"dateInserted":"2023-10-04T15:20:08+00:00","dateUpdated":null,"dateLastComment":"2023-10-04T18:59:48+00:00","insertUserID":78761,"insertUser":{"userID":78761,"name":"tmkj20","url":"https:\/\/community.smartsheet.com\/profile\/tmkj20","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!gnPeZ7gLMjw!!EdcH89Wp7wc","dateLastActive":"2023-10-04T17:29:41+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭"},"updateUserID":null,"lastUserID":45516,"lastUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-10-04T23:32:17+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":4,"countViews":29,"score":null,"hot":3392881196,"url":"https:\/\/community.smartsheet.com\/discussion\/111186\/dividing-to-create-a","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/111186\/dividing-to-create-a","format":"Rich","lastPost":{"discussionID":111186,"commentID":398450,"name":"Re: Dividing to Create a %","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/398450#Comment_398450","dateInserted":"2023-10-04T18:59:48+00:00","insertUserID":45516,"insertUser":{"userID":45516,"name":"Paul Newcome","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20Newcome","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/082\/nQPUTVFKKWDJ2.jpg","dateLastActive":"2023-10-04T23:32:17+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-10-04T17:30:15+00:00","dateAnswered":"2023-10-04T16:17:20+00:00","acceptedAnswers":[{"commentID":398399,"body":"
You would just use<\/p>
=[Column B]@row \/ [Column A]@row <\/p>
<\/p>
EDIT: Then apply the percentage format to the column.<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]},{"discussionID":111167,"type":"question","name":"Looking to Countif a person's name is contained in a column that allows for multiple contacts.","excerpt":"=COUNTIFS({OTP Goals Project Lead}, CONTAINS(Contact@row)) the OTP Goals Project Lead is the sheet that has the column that is a contact list that allows for multiple contacts. If a person's name is contained in that column and it matches the name in the column on the metrics sheet called Contact - then I want it to count…","snippet":"=COUNTIFS({OTP Goals Project Lead}, CONTAINS(Contact@row)) the OTP Goals Project Lead is the sheet that has the column that is a contact list that allows for multiple contacts. If…","categoryID":322,"dateInserted":"2023-10-04T02:50:21+00:00","dateUpdated":null,"dateLastComment":"2023-10-04T13:57:49+00:00","insertUserID":131821,"insertUser":{"userID":131821,"name":"Melitta","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Melitta","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!7FjR-2zeSSY!zOlQs_Tjxjo!J3yyx3hqT9S","dateLastActive":"2023-10-05T01:24:07+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭"},"updateUserID":null,"lastUserID":8888,"lastUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-10-05T02:57:00+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":34,"score":null,"hot":3392817490,"url":"https:\/\/community.smartsheet.com\/discussion\/111167\/looking-to-countif-a-persons-name-is-contained-in-a-column-that-allows-for-multiple-contacts","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/111167\/looking-to-countif-a-persons-name-is-contained-in-a-column-that-allows-for-multiple-contacts","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":111167,"commentID":398349,"name":"Re: Looking to Countif a person's name is contained in a column that allows for multiple contacts.","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/398349#Comment_398349","dateInserted":"2023-10-04T13:57:49+00:00","insertUserID":8888,"insertUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-10-05T02:57:00+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-10-04T11:48:58+00:00","dateAnswered":"2023-10-04T09:06:57+00:00","acceptedAnswers":[{"commentID":398315,"body":"
Hi @Melitta<\/a> <\/p> I hope you're well and safe!<\/p> Try something like this.<\/p> =COUNTIFS({OTP Goals Project Lead}, CONTAINS(Contact@row,@cell)<\/p> Did that work\/help? <\/p> I hope that helps!<\/p> Be safe, and have a fantastic week!<\/p> Best,<\/p> Andrée Starå<\/strong><\/a> | Workflow Consultant \/ CEO @ WORK BOLD<\/strong><\/a><\/p> ✅Did my post(s) help or answer your question or solve your problem? Please support the Community by <\/em>marking it Insightful\/Vote Up, Awesome, or\/and as the accepted answer<\/em><\/strong>. It will make it easier for others to find a solution or help to answer!<\/em><\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":254,"urlcode":"formulas","name":"Formulas"}]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&categoryID=322&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&sort=-hot&limit=3&expand%5B0%5D=all&expand%5B1%5D=-body&expand%5B2%5D=insertUser&expand%5B3%5D=lastUser&status=accepted","prevURL":null,"currentPage":1,"total":10000,"limit":3},"title":"Trending in Formulas and Functions ","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">