Is it possible to flag duplicates when the data starts with a 0 (zero)?

Hi!

I have a sheet that tracks hundreds of cell phones, so it's really important to ensure existing records are updated rather than added as new rows. I can flag columns like Asset Tag and Phone Number with this formula =IF(COUNTIF([Asset Tag]:[Asset Tag],[Asset Tag]@row)>1,1,0) .


The problem is that this doesn't work for the IMEI column. The reason is that these numbers start with 0 (zero). SmartSheet appends a ' to the data (e.g. 0123 is '0123). If you take the '0 out, the formula works. But then the data is wrong. Is there a way to make this work?

Thanks a ton!

Eric

Best Answer

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭
    Answer ✓

    Hi@Eric Busse,

    Below is the formula and structure I'm using. The formula examines row 1 down to the current row and if it finds a duplicate it returns a 1 which checks the Checkbox. I also tried it with full alpha (e.g. ABCD) and got the expected return. The FAA column is Text/Number and the Duplicate is a Checkbox. Let me know how I can help.

    Mark

    temp count leading 0.JPG



    I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.

Answers

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭

    Hi@Eric Busse,

    I'm not able to duplicate your error. The formula =IF(COUNTIF([IMEI]:[IMEI],[IMEI]@row)>1,1,0) works for me. COUNTIF works with text and numbers in the same range. Smartsheets treats your leading 0 lines as text. It should match them to other text strings. Are you getting an error or just the wrong answer?

    Mark


    I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭
    edited 01/08/21



    I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.

  • Hi Mark,

    It works in the same sheet, using the same formula, with cells that are numeric and alpha characters. It only breaks on cells that start with a zero. For example '015099000210745. I suspect it may have something to do with the leading apostrophe '.

    Does it work for you with data like that (e.g. '0123 )?

    Thanks a ton!

    Eric

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭

    Hi Eric,

    Yes it works for me. IThe ' makes smartsheet use the string as text instead of a number. That's what allows the leading 0 to remain visible. I mixed text strings (leading 0s) and numbers in the same column and my count functions worked and returned the right answers.

    If the string is text, Smartsheet should match that text string to other text strings an return the count. Is the Column set as a text/number format? I'm not sure what else to look at with your sheet. Maybe someone else will have an idea. Lots of smart and creative people in the Community.

    Mark


    I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.

  • Hi Mark,

    I created a new sheet to test this out. As you can see, ABC and 123 flag dups no problem. When I have a numeric field that starts with a 0, SmartSheet prepends the '. The same formula that works for the other rows does not flag the "0123" entries.

    If this is working for you, can you share your formula?

    Thanks,

    Eric

    image.png


  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭
    Answer ✓

    Hi@Eric Busse,

    Below is the formula and structure I'm using. The formula examines row 1 down to the current row and if it finds a duplicate it returns a 1 which checks the Checkbox. I also tried it with full alpha (e.g. ABCD) and got the expected return. The FAA column is Text/Number and the Duplicate is a Checkbox. Let me know how I can help.

    Mark

    temp count leading 0.JPG



    I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.

  • That did it! Thank you so much Mark.


    I was using "=IF(COUNTIF([IMEI]:[IMEI],[IMEI]@row)>1,1,0)". This worked for everything except the fields where the leading character was a zero. Plugged in "=IF(CountIF(IMEI$1:[email protected], @cell =[email protected])>1,1,0)" and problem solved!


    All the Best,

    Eric

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭

    Glad you were able to figure it out. Thanks for contributing to the Community.

    Be Well,

    Mark


    I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the公式手册模板!
@Kris Peeters<\/a> <\/p>

you should be able to use =Countifs([Al Javor]@row:[Lisa Young]@row,\"1 - High\")<\/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":108307,"type":"question","name":"Formula to Average Performance Score for Various Service Categories","excerpt":"I am trying to create a formula that averages the performance score of various service categories. For example, whenever the service category (drop down box) has \"civil engineer\" selected, I want a running formula that averages all the civil engineer ratings. I have tried using the =averageif() formula, but I continue to…","snippet":"I am trying to create a formula that averages the performance score of various service categories. For example, whenever the service category (drop down box) has \"civil engineer\"…","categoryID":322,"dateInserted":"2023-07-31T15:35:13+00:00","dateUpdated":"2023-07-31T15:48:17+00:00","dateLastComment":"2023-07-31T18:57:50+00:00","insertUserID":164346,"insertUser":{"userID":164346,"name":"ullkay95","url":"https:\/\/community.smartsheet.com\/profile\/ullkay95","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!bmtAmxLQVL0!e6DCx07vJ9c!25n9oP55COS","dateLastActive":"2023-07-31T18:59:28+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":164346,"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-07-31T19:57:04+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":11,"countViews":31,"score":null,"hot":3381654183,"url":"https:\/\/community.smartsheet.com\/discussion\/108307\/formula-to-average-performance-score-for-various-service-categories","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/108307\/formula-to-average-performance-score-for-various-service-categories","format":"Rich","lastPost":{"discussionID":108307,"commentID":388084,"name":"Re: Formula to Average Performance Score for Various Service Categories","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/388084#Comment_388084","dateInserted":"2023-07-31T18:57:50+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-07-31T19:57:04+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\/2HQ91LNQF3GG\/screenshot-2023-07-31-114610.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"Screenshot 2023-07-31 114610.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-07-31T18:52:12+00:00","dateAnswered":"2023-07-31T18:48:05+00:00","acceptedAnswers":[{"commentID":388078,"body":"

In that case you would use the same syntax but you would reference the column in the sheet using the appropriate column name. <\/p>

[Column name]:[Column name]<\/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":108278,"type":"question","name":"How do you calculate the average number of days between a submitted date and a start date?","excerpt":"Additional context: We use Smartsheet to track support requests from the organization. We have an automated column that records the day the form is filled out. The form also has a date range of when they need their request completed by. I would like to calculate the average amount of days people provide from the day they…","snippet":"Additional context: We use Smartsheet to track support requests from the organization. We have an automated column that records the day the form is filled out. The form also has a…","categoryID":322,"dateInserted":"2023-07-28T20:36:42+00:00","dateUpdated":null,"dateLastComment":"2023-07-28T21:00:45+00:00","insertUserID":128090,"insertUser":{"userID":128090,"name":"Carlos Fernandez-Torres","url":"https:\/\/community.smartsheet.com\/profile\/Carlos%20Fernandez-Torres","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-07-28T21:30:09+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-07-31T19:57:04+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":40,"score":null,"hot":3381156447,"url":"https:\/\/community.smartsheet.com\/discussion\/108278\/how-do-you-calculate-the-average-number-of-days-between-a-submitted-date-and-a-start-date","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/108278\/how-do-you-calculate-the-average-number-of-days-between-a-submitted-date-and-a-start-date","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":108278,"commentID":387924,"name":"Re: How do you calculate the average number of days between a submitted date and a start date?","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/387924#Comment_387924","dateInserted":"2023-07-28T21:00:45+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-07-31T19:57:04+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\/QO67SBLMOJQA\/image.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"image.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2023-07-28T21:01:27+00:00","dateAnswered":"2023-07-28T21:00:45+00:00","acceptedAnswers":[{"commentID":387924,"body":"

=[End Date]@row - [Start Date]@row<\/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