How would I write a formula to locate duplicates in 1 column and the difference in another column.
I have 1 sheet that has duplicated Classroom IDs but different scores on each line. I need to flag any instances during the same term of a difference over 1.00 higher or lower with the same Classroom ID.
I need to find the repeat instances within column "Classroom ID" that occur during the same Column "Term Name" and then find the difference between the 2 rows being compared in column "ES Domain", highlighting any differences with a difference of over +/- 1.00.
I have been able to come up with a formula to identify instances of the same classroom ID but I am struggling to compare one found row to another found row to get the difference. I also have not yet added in the requirement for the term to match. I am including what I have below which leads all the answers to be 0 since it is subtracting the ES Domain cell from itself.
=IF(INDEX([Classroom ID]:[Classroom ID], MATCH([Classroom ID]@row, [Classroom ID]:[Classroom ID]), 0) = [Classroom ID]@row, [ES Domain]@row - [ES Domain]@row, " ")
Thank you!
Best Answer
-
This should do the trick:
=IF(MAX(COLLECT([ES Domain]:[ES Domain], [Classroom ID]:[Classroom ID], @cell = [Classroom ID]@row, [Term Name]:[Term Name], @cell = [Term Name]@row)) - MIN(COLLECT([ES Domain]:[ES Domain], [Classroom ID]:[Classroom ID], @cell = [Classroom ID]@row, [Term Name]:[Term Name], @cell = [Term Name]@row)) > 1, MAX(COLLECT([ES Domain]:[ES Domain], [Classroom ID]:[Classroom ID], @cell = [Classroom ID]@row, [Term Name]:[Term Name], @cell = [Term Name]@row)) - MIN(COLLECT([ES Domain]:[ES Domain], [Classroom ID]:[Classroom ID], @cell = [Classroom ID]@row, [Term Name]:[Term Name], @cell = [Term Name]@row)))
Answers
-
Are you able to provide some screenshots for context?
-
Yes, this is the sample sheet I've been using to test it.
-
Try something like this:
=IF(MAX(COLLECT([ES Domain]:[ES Domain], [Classroom ID]:[Classroom ID], @cell = [Classroom ID]@row, [Term Name]:[Term Name], @cell = [Term Name]@row)) - MIN(COLLECT([ES Domain]:[ES Domain], [Classroom ID]:[Classroom ID], @cell = [Classroom ID]@row, [Term Name]:[Term Name], @cell = [Term Name]@row)) > 1, "large discrepancy output")
-
That is very helpful, thank you!
Is there a way to make it so that it will display the difference between the cells compared?
-
This should do the trick:
=IF(MAX(COLLECT([ES Domain]:[ES Domain], [Classroom ID]:[Classroom ID], @cell = [Classroom ID]@row, [Term Name]:[Term Name], @cell = [Term Name]@row)) - MIN(COLLECT([ES Domain]:[ES Domain], [Classroom ID]:[Classroom ID], @cell = [Classroom ID]@row, [Term Name]:[Term Name], @cell = [Term Name]@row)) > 1, MAX(COLLECT([ES Domain]:[ES Domain], [Classroom ID]:[Classroom ID], @cell = [Classroom ID]@row, [Term Name]:[Term Name], @cell = [Term Name]@row)) - MIN(COLLECT([ES Domain]:[ES Domain], [Classroom ID]:[Classroom ID], @cell = [Classroom ID]@row, [Term Name]:[Term Name], @cell = [Term Name]@row)))
-
Thank you so much! That is amazing. It worked perfectly!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 66.9K Get Help
- 441 Global Discussions
- 153 Industry Talk
- 501 Announcements
- 5.4K Ideas & Feature Requests
- 85 Brandfolder
- 155 Just for fun
- 79 Community Job Board
- 511 Show & Tell
- 34 Member Spotlight
- 2 SmartStories
- 308 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!