Removing duplicates by moving to another sheet
Hi, I have sheets A and B. Sheet A is set up that with a row that marks all duplicates as 2. I want to set up a formula that says, "If a column Duplicates is marked 2 and the customer information contains the word outdated, only move the first occurrence to Sheet B. " Leaving one copy of the duplicated on the sheet.
Thank you
Answers
-
Are your duplicates likely to be created on the same day?
If not, you might consider using The YEAR and YEARDAY functions to find the Julian style Created date, and a formula to then collect the lowest Julian number of the duplicate rows and set a cell value that triggers your automation to move the row out.
For a row created on January 18, 2022 this formula: =VALUE(YEAR(Created@row)+""+YEARDAY(Created@row))
would return 202218. For March 8, 2022, it would be 202267.
Get your first occurrence in a EarliestDate column:
=IF(Duplicates@row =2, MIN(COLLECT(Julian:Julian, CustomerInfo:CustomerInfo, CONTAINS("outdated", @cell))), "")
In English: If this row is a duplicate, collect the lowest value from the Julian column where customerInfo contains the word "outdated".
Then one more column, ToBeMoved:
=IF(EarliestDate@row < Julian@row, 1, "")
If the collected earliest julian date is lower than the julian date on this row, set this cell to 1.
Then automation rule to move the row when ToBeMoved changes to 1.
Regards,
Jeff Reisman
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
-
Then one more column, ToBeMoved:
=IF(EarliestDate@row < Julian@row, 1, "")
If the collected earliest julian date is lower than the julian date on this row, set this cell to 1.
Then automation rule to move the row when ToBeMoved changes to 1.
Just reading this over with fresh eyes this morning. This should actually be set to where EarliestDate@row = Julian@row, that way you're deleting the first occurrence.
=IF(EarliestDate@row = Julian@row, 1, "")
IF the collected earliest Julian date is the same as the Julian date on this row, set the cell to 1.
Also - once you are sure all your formulas work, you might be able to combine some of these and remove an extraneous column...
=IF(IF(Duplicates@row =2, MIN(COLLECT(Julian:Julian, CustomerInfo:CustomerInfo, CONTAINS("outdated", @cell))), "") = Julian@row, 1, "")
This collects the lowest Julian date if the row matches the criteria, compares it to the Julian date, and if they are equal, sets the cell to 1 in order to trigger the automated move. This eliminates the need for the EarliestDate column. (I've tested all the above and they all work.)
Regards,
Jeff Reisman
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
-
Thank you
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64K Get Help
- 410 Global Discussions
- 220 Industry Talk
- 459 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 137 Just for fun
- 57 Community Job Board
- 459 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 298 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!