Counting Unique and First Values Using MIN / COLLECT

@Paul Newcome- I tried using a solution you recommended on another thread for counting the truly unique and first-instance-of-duplicate values in a column, and I've hit a wall - could use your help (or anyone else who is way smarter at formulas than I am ...)

2020-10-07_14-58-46.png


[行ID] =uto-number

[Lookup Index] = Join of [Product Family] + [BE2] + [Sub BE] to create unique string

[Product Family] = alphanumeric string. This is imported through Data Uploader from another source. Cannot be edited.

COLUMNS YOU CAN"T SEE in screenshot ...

[Count] = Count of how many times the same alphanumeric string appears in the [Product Family] column

[First Entry] = checkbox column where the formula will ultimately go to identify unique + first-instance values in [Product Family] column.


I tried this formula:

=IF([Row ID]@row = MIN(COLLECT([Row ID]:[Row ID], Count:Count, >1, [Product Family]:[Product Family], [Product Family]@row)), 1)

The formula "works" (meaning, no errors), but it doesn't check the box for ANYTHING. Cannot figure out why. I thought maybe Smartsheet did not like the all-caps in the Product Family name, so I tried converting to lowercase, but still nothing. ♀️

Best Answers

Answers

  • Genevieve P.
    Genevieve P. Employee Admin

    Hi@Danielle Arteaga

    TheMIN functioncan only be used with numerical data or dates. Currently the way your auto-number column is set up has text in front of it, as well as a number. This means the MIN will return 0, since there are 0 numbers in that column.

    You could potentially add in a different, helper/hidden System column (like acreated date column) to then use in the MIN formula. It would be the exact same formula, just referencing a different column to check and find the MIN.

    =IF([Created Column]@row = MIN(COLLECT([Created Column]:[Created Column], Count:Count, >=1, [Product Family]:[Product Family], [Product Family]@row)), 1)

    Note that in my example I also added an = sign after the COUNT range... as I presume you also want to check boxes for rows that only have one unique entry (is that correct?).

    Let me know if this works for you!

    Cheers,

    Genevieve

  • Danielle Arteaga
    Danielle Arteaga ✭✭✭✭✭✭
    edited 10/08/20

    Hi, Genevieve - thanks so much for the suggestion. I modified my Row ID column so that it is only numeric (no alpha prefix), but still nothing.

    I also tried adding an auto-create column as you suggested, and I got the opposite result - EVERY box is checked.

    Screen Shot 2020-10-08 at 8.37.22 AM.png

    Similarly, I tried alternating the formula to reference [Repeat Product Family] (which converts [Product Family] to lower case), but no change.

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Answer ✓

    You could try something like this...

    =IF(COUNTIFS([Lookup Index]$1:[Lookup Index]@row, [Lookup Index]@row) = 1, 1)

  • Danielle Arteaga
    Danielle Arteaga ✭✭✭✭✭✭
    You could try something like this...<\/p>

    =IF(COUNTIFS([Lookup Index]$1:[Lookup Index]@row, [Lookup Index]@row) = 1, 1)<\/p>","bodyRaw":"[{\"insert\":\"You could try something like this...\\n=IF(COUNTIFS([Lookup Index]$1:[Lookup Index]@row, [Lookup Index]@row) = 1, 1)\\n\"}]","format":"rich","dateInserted":"2020-10-08T15:55:05+00:00","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-09-26T15:26:43+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"displayOptions":{"showUserLabel":false,"showCompactUserInfo":true,"showDiscussionLink":false,"showPostLink":false,"showCategoryLink":false,"renderFullContent":false,"expandByDefault":false},"url":"https:\/\/community.smartsheet.com\/discussion\/comment\/265338#Comment_265338","embedType":"quote"}"> https://community.smartsheet.com/discussion/comment/265338#Comment_265338

    Perfect. Of course it was this easy. ;-) Thank you.

  • Genevieve P.
    Genevieve P. Employee Admin

    Thanks, Paul!! Great answer.

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    @Danielle ArteagaHappy to help.


    @Genevieve PThanks! Sometimes it just takes an extra set of eyes.

Help Article Resources

想练习使用公式可怕ctly in Smartsheet?

Check out the公式手册模板!
Got it - then try this: =IF([Column 3]@row = 1, \"Red\", IF(OR(CONTAINS(\"Term\", [Column 1]@row), [Column 2]@row = 1), \"Green\", \"Yellow\"))<\/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"}]},{"discussionID":110803,"type":"question","name":"Can I create one workflow to notify multiple conditional paths or does each condition need it's own?","excerpt":"Hello, I am trying to create a workflow where specific people at a given project are notified when a request is fulfilled. I have set it up as it appears in the included picture but I am only receiving alerts when the first project is selected. Do I have to create a separate workflow for each of the projects or is there a…","snippet":"Hello, I am trying to create a workflow where specific people at a given project are notified when a request is fulfilled. I have set it up as it appears in the included picture…","categoryID":322,"dateInserted":"2023-09-26T18:00:51+00:00","dateUpdated":null,"dateLastComment":"2023-09-26T19:59:23+00:00","insertUserID":167481,"insertUser":{"userID":167481,"name":"dbarrett013","title":"Recruiter","url":"https:\/\/community.smartsheet.com\/profile\/dbarrett013","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!mSFEHvF9s_w!w29F_9VbvXo!o6l2bx9HzJh","dateLastActive":"2023-09-26T19:58:16+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":167481,"lastUser":{"userID":167481,"name":"dbarrett013","title":"Recruiter","url":"https:\/\/community.smartsheet.com\/profile\/dbarrett013","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!mSFEHvF9s_w!w29F_9VbvXo!o6l2bx9HzJh","dateLastActive":"2023-09-26T19:58:16+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":13,"score":null,"hot":3391510814,"url":"https:\/\/community.smartsheet.com\/discussion\/110803\/can-i-create-one-workflow-to-notify-multiple-conditional-paths-or-does-each-condition-need-its-own","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/110803\/can-i-create-one-workflow-to-notify-multiple-conditional-paths-or-does-each-condition-need-its-own","format":"Rich","tagIDs":[218,334,440,448,510],"lastPost":{"discussionID":110803,"commentID":397076,"name":"Re: Can I create one workflow to notify multiple conditional paths or does each condition need it's own?","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/397076#Comment_397076","dateInserted":"2023-09-26T19:59:23+00:00","insertUserID":167481,"insertUser":{"userID":167481,"name":"dbarrett013","title":"Recruiter","url":"https:\/\/community.smartsheet.com\/profile\/dbarrett013","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!mSFEHvF9s_w!w29F_9VbvXo!o6l2bx9HzJh","dateLastActive":"2023-09-26T19:58:16+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,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/9U0EAQPETP78\/smartsheet-workflow-png.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"Smartsheet workflow.PNG"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-09-26T19:58:57+00:00","dateAnswered":"2023-09-26T19:53:51+00:00","acceptedAnswers":[{"commentID":397075,"body":"

@dbarrett013<\/a> I think the workflow stops once the first leg\/first project is executed because there's no trigger asking it to check the rest of your conditions. I guess you should try separating these and see if that resolves it.<\/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":218,"urlcode":"construction","name":"Construction"},{"tagID":334,"urlcode":"automations","name":"Automations"},{"tagID":440,"urlcode":"project-management","name":"Project Management"},{"tagID":448,"urlcode":"workflows-in-smartsheet","name":"Workflows in Smartsheet"},{"tagID":510,"urlcode":"email-notifications","name":"Email Notifications"}]},{"discussionID":110806,"type":"question","name":"I need to change a column named Event Type to a \"V\" or \"I\" based on the value of another column.","excerpt":"I need to change the Event Type column to a \"V\" or \"I\" if a column named Event location contain the word \"Virtual\" or \"virtual\". I have tried several versions of IF statements but they all give errors. Below is the last version I tried. =IF([Event Location]@row, \"Virtual\", \"V\", IF([Event Location]@row, \"virtual\"), \"V\",…","snippet":"I need to change the Event Type column to a \"V\" or \"I\" if a column named Event location contain the word \"Virtual\" or \"virtual\". I have tried several versions of IF statements but…","categoryID":322,"dateInserted":"2023-09-26T18:15:29+00:00","dateUpdated":null,"dateLastComment":"2023-09-26T19:12:40+00:00","insertUserID":154002,"insertUser":{"userID":154002,"name":"SmartSheet Newbie","url":"https:\/\/community.smartsheet.com\/profile\/SmartSheet%20Newbie","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/OLZT5TMCDLUA\/nLGJGXEA8PX07.png","dateLastActive":"2023-09-26T19:12:34+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":159703,"lastUser":{"userID":159703,"name":"Monique_Odom_Comcast","title":"Process Manager","url":"https:\/\/community.smartsheet.com\/profile\/Monique_Odom_Comcast","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!zUkrM9vny0o!ZQkomVvUbwo!vBgDVSQJmmG","dateLastActive":"2023-09-26T19:05:43+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":19,"score":null,"hot":3391508889,"url":"https:\/\/community.smartsheet.com\/discussion\/110806\/i-need-to-change-a-column-named-event-type-to-a-v-or-i-based-on-the-value-of-another-column","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/110806\/i-need-to-change-a-column-named-event-type-to-a-v-or-i-based-on-the-value-of-another-column","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":110806,"commentID":397060,"name":"Re: I need to change a column named Event Type to a \"V\" or \"I\" based on the value of another column.","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/397060#Comment_397060","dateInserted":"2023-09-26T19:12:40+00:00","insertUserID":159703,"insertUser":{"userID":159703,"name":"Monique_Odom_Comcast","title":"Process Manager","url":"https:\/\/community.smartsheet.com\/profile\/Monique_Odom_Comcast","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!zUkrM9vny0o!ZQkomVvUbwo!vBgDVSQJmmG","dateLastActive":"2023-09-26T19:05:43+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-09-26T19:16:50+00:00","dateAnswered":"2023-09-26T19:10:41+00:00","acceptedAnswers":[{"commentID":397059,"body":"

@SmartSheet Newbie<\/a> <\/p>

This should work regardless of capitalization (but may not catch spelling errors):<\/p>

=IF(CONTAINS(\"virtual\", [Event Location]@row) = true, \"V\", \"I\")<\/p>

\n
\n \n \"image.png\"<\/img><\/a>\n <\/div>\n<\/div>\n

Hope this helps!<\/p>"},{"commentID":397060,"body":"

Hello @SmartSheet Newbie<\/a>, (Love the name!)<\/p>

Formulas aren't by nature case sensitive (unless you specify that information), so this can be simplified. An IF formula is basically set up as IF: this, then A, otherwise B - so we can also take out the last two statements. Try this:<\/p>

=IF([Event Location]@row = \"virtual\", \"V\", \"I\")<\/p>

If people have the ability to put spaces or other text, then you might want to consider adding a Contains layer:<\/p>

=IF(CONTAINS(\"virtual\", [Event Location]@row), \"V\", \"I\")<\/p>

And last, if you don't want to rely on a formula, you could actually create an Automation to change the cell in the Event Type column. Your automation would look something like this: When a row is added or changed, where Event Location contains \"virtual\" (this would be a condition), change cell in Event Type to \"V\", otherwise change cell in Event Type to \"I\".<\/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":[]}">

Trending in Formulas and Functions