Duplicate Helper column with filter
Hi!
I'm trying to build a formula where I search for duplicates within one column (Job Numbers) but only if "Invoice" has been selected in another column (Deliverable Type). I was able to get a formula to search for duplicates working but it is searching all the deliverable types, but I just need to know if there is more than one invoice submitted with the same job number. Thank you!
Best Answer
-
@T.Shuya Okay, final answer, sorry. This should work
=IF([Deliverable Type]@row <> "Invoice", 0, IF(COUNTIFS([Job Number]:[Job Number], [Job Number]@row, [Deliverable Type]:[Deliverable Type], @cell = "invoice") > 1, 1, 0))
Answers
-
@T.Shuya try something like this. Update the words in the brackets to match your column names.
=countifs([jobnumbers]:[jobnumbers], [jobnumbers]@row, [deliverable type]:[deliverable type], [deliverable type]@row)
This formula will return a number from 0 to 1, 2, etc. depending on how many times the critera is met. anything greater than 1 means a duplicate.
Depending on what you need returned, you can put this in an if statement like so:
=if( countifs([jobnumbers]:[jobnumbers], [jobnumbers]@row, [deliverable type]:[deliverable type], [deliverable type]@row) >0, "Duplicate", "Unique")
** if deliverable type is a multi select dropdown, you will need to use contains or has: contains("invoice",@cell)
-
Thanks Sam! Not quite working the way I'd hoped. I'd like a check mark to appear in the "Duplicate Helper" column when there are duplicates in the job number column. I only want it to check and return a result if the "Deliverable Type" is "Invoice" which is a single select drop down. So if the deliverable type is "Report" it won't consider them. We usually get a report and an invoice with the same job number but sometimes we have multiple invoices with the same job number and I want to show that visually as it effects or process to complete them.
-
@T.Shuya try this then,
=if( countifs([job number]:[job number], [job number]@row, [deliverable type]:[deliverable type], "invoice") >0, 1, 0)
Sorry I put deliverabletype @row instead of "invoice"
-
Thank you so much for helping!! But that still isn't working. This just check marked all the invoice lines but not the duplicates.
-
@T.Shuya Okay, final answer, sorry. This should work
=IF([Deliverable Type]@row <> "Invoice", 0, IF(COUNTIFS([Job Number]:[Job Number], [Job Number]@row, [Deliverable Type]:[Deliverable Type], @cell = "invoice") > 1, 1, 0))
-
You are amazing! Thank you very much!!!
-
This worked amazing but I overlooked another issue. I have another column (Status) and I also need the formula to ignore the "completed" invoices that are in the status column. Is it possible to add it?
-
You can add an "or" condition at the beginning like this:
=IF(OR([Deliverable Type]@row <> "Invoice", Status@row = "Complete"), 0, IF(COUNTIFS([Job Number]:[Job Number], [Job Number]@row, [Deliverable Type]:[Deliverable Type], "invoice") > 1, 1, 0))
-
Didn't quite work or it worked the opposite of how it should. I would like the invoices that aren't completed to have the check mark. The parameters are now: Show a flag if there are duplicate invoices with the same job number that are not completed.
-
@T.Shuya Try this
=IF([Deliverable Type]@row <> "Invoice", 0, IF(COUNTIFS([Job Number]:[Job Number], [Job Number]@row, [Deliverable Type]:[Deliverable Type], "invoice", Status:status, "<>Complete") > 1, 1, 0))
-
I can't tell you how much I appreciate your help on this. It still doesn't seem to work as it will also flag completed invoices and their duplicates.
-
@T.Shuya Ok lets combine the criteria,
Try this -
=IF(OR([Deliverable Type]@row <> "Invoice", Status@row = "Complete"), 0, IF(COUNTIFS([Job Number]:[Job Number], [Job Number]@row, [Deliverable Type]:[Deliverable Type], "invoice", Status:Status, "<>Complete") > 1, 1, 0))
-
No go. I wish I knew formulas.
-
Tell me again what you are trying to do, now? it's working in my test. Invoice that's not started with duplicate job numbers. All the other duplicates either have complete, or are bills. 1 indicates a checkbox or flag
-
@T.Shuya my formula says complete, you may need to change it to completed
=IF(OR([Deliverable Type]@row <> "Invoice", Status@row = "Completed"), 0, IF(COUNTIFS([Job Number]:[Job Number], [Job Number]@row, [Deliverable Type]:[Deliverable Type], "invoice", Status:Status, "<>Completed") > 1, 1, 0))
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!