leaving the first duplicate unchecked

I'm doing a duplicate formula in a column and I am wanting the first duplicate to remain unchecked, how is this done? Here is currently formula for the duplicate:

Using the column type as a Flag

=IF(COUNTIF([Parent Code]:[Parent Code], [Parent Code]@row) > 1, 1, 0)

Best Answer

  • Kerry St. Thomas
    Kerry St. Thomas Community Champion
    Answer ✓

    The way that I've solved this is to leverage the Autonumber column. This way your result will be based on when the row was created. (Make sure the column is just numbered and doesn't have any formatting associated with it, or you'll first need to create a helper column that has ONLY numerical info - using VALUE or something along those lines, depending on your format):

    =IF(MIN(COLLECT(Autonum:Autonum, [Parent Code]:[Parent Code], [Parent Code]@row)) = Autonum@row, 1, 0)

    This will check the box if there's only one Parent Code, and will also check the first row of any duplicates of that Parent Code. If you want to ONLY identify duplicates and not rows with one Item, you'd just integrate what I'm suggesting into your existing formula.

    Good luck!

    If this answer resolves your question, please help the Community by marking it as an accepted answer. I'd also be grateful for your response - "Insightful"or "Awesome" reactions are much appreciated. Thanks!

Answers

  • Kerry St. Thomas
    Kerry St. Thomas Community Champion
    Answer ✓

    The way that I've solved this is to leverage the Autonumber column. This way your result will be based on when the row was created. (Make sure the column is just numbered and doesn't have any formatting associated with it, or you'll first need to create a helper column that has ONLY numerical info - using VALUE or something along those lines, depending on your format):

    =IF(MIN(COLLECT(Autonum:Autonum, [Parent Code]:[Parent Code], [Parent Code]@row)) = Autonum@row, 1, 0)

    This will check the box if there's only one Parent Code, and will also check the first row of any duplicates of that Parent Code. If you want to ONLY identify duplicates and not rows with one Item, you'd just integrate what I'm suggesting into your existing formula.

    Good luck!

    If this answer resolves your question, please help the Community by marking it as an accepted answer. I'd also be grateful for your response - "Insightful"or "Awesome" reactions are much appreciated. Thanks!

  • dharberts
    dharberts ✭✭✭

    Thank you that did the trick!!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!