Ranking values in a range based on matching a date
Hi Smartsheeters -
I'm in a post-Covid brain fog and trying to work this problem. I have a list of materials. For each material, I list a warehouse, a quantity of scanning errors, and a date. I have a rank column I need to populate with the top 5 highest quantity for a given date at a given warehouse.
Here's a snapshot of what the data looks like:
In a nutshell, for a given date, rank the highest quantity for material in each of three warehouses (4000, 4200, 4300.) So all the 4000 values have their top 5 for 12/1/2020, all the 4200 values have their top 5 for 12/1/2020, all the 4300 values have their top 5 for 12/1/2020, and so on for each date.
It doesn't matter if I only have a 1st highest and 2nd highest, with everything else being equal (ex. quantity values of 32, 27, 1,1,1,1,1,1). That's ok, because in that case we really only care about the highest values above all the others.
Thanks in advance! Covid-brain-fog is no joke!
Regards,
Jeff Reisman,IT Business Analyst & Project Coordinator,Mitsubishi Electric Trane US
链接:Smartsheet Functions Help Pages链接: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!
Best Answer
-
Mark Cronk ✭✭✭✭✭✭
Hi@JReisman27,
Try this in your Rank column:
=RANKEQ(quantity@row, COLLECT(Quantity:Quantity, Warehouse:Warehouse, @cell=warehouse@row, date:date, @cell=date@row), 1)
Work?
It will rank each quantity by warehouse by day. If you only want top 5 I can help modify it for you.
Mark
I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.
Answers
-
Mark Cronk ✭✭✭✭✭✭
Hi@JReisman27,
Try this in your Rank column:
=RANKEQ(quantity@row, COLLECT(Quantity:Quantity, Warehouse:Warehouse, @cell=warehouse@row, date:date, @cell=date@row), 1)
Work?
It will rank each quantity by warehouse by day. If you only want top 5 I can help modify it for you.
Mark
I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.
-
Jeff Reisman ✭✭✭✭✭✭
Thanks Mark! This worked perfectly; once I changed theorderoption to 0, it gave me the proper order for the rank (highest number is ranked #1, second highest number ranked #2, etc.)
=RANKEQ(Qty@row, COLLECT(Qty:Qty, Warehouse:Warehouse, @cell = Warehouse@row, Date:Date, @cell = Date@row),0)
I had been trying the embedded COLLECT function but I forgot about using the "@cell =" because it's not in any of the examples for that function. I've used it before, but I have so many complex formulas scattered about that I couldn't for the life of me remember where I had used complex COLLECT functions before.
I'm going to suggest to my client dev manager that Smartsheet support start adding links on the functions details pages that go to more in depth and complex examples of using that function in everyday scenarios.
Regards,
Jeff Reisman,IT Business Analyst & Project Coordinator,Mitsubishi Electric Trane US
链接:Smartsheet Functions Help Pages链接: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!
-
Mark Cronk ✭✭✭✭✭✭
Excellent. Glad you found a solution. Thank you for contributing to the Community.
Mark
I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.
Help Article Resources
Categories
=IF(AND([Average Score]@row>= 5, [Average Score]@row<= 9), \"Project\", IF(AND([Average Score]@row>= 10, [Average Score]@row<= 15), \"Program\"))<\/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":110985,"type":"question","name":"Dashboard Last Updated Date","excerpt":"I would like to display the last time the dashboard was updated. My approach was adding a date field in the summary data that automatically pulls the last saved date of the sheet. I don't think I can do a formula in the date field type. Any other suggestions?","snippet":"I would like to display the last time the dashboard was updated. My approach was adding a date field in the summary data that automatically pulls the last saved date of the sheet.…","categoryID":322,"dateInserted":"2023-09-29T12:56:38+00:00","dateUpdated":"2023-09-29T23:58:27+00:00","dateLastComment":"2023-09-29T16:19:19+00:00","insertUserID":167704,"insertUser":{"userID":167704,"name":"Jenn Moffett","title":"Director, PMO","url":"https:\/\/community.smartsheet.com\/profile\/Jenn%20Moffett","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-09-29T15:38:19+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":166028,"lastUserID":167704,"lastUser":{"userID":167704,"name":"Jenn Moffett","title":"Director, PMO","url":"https:\/\/community.smartsheet.com\/profile\/Jenn%20Moffett","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-09-29T15:38:19+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":30,"score":null,"hot":3391997757,"url":"https:\/\/community.smartsheet.com\/discussion\/110985\/dashboard-last-updated-date","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/110985\/dashboard-last-updated-date","format":"Rich","tagIDs":[292,335],"lastPost":{"discussionID":110985,"commentID":397701,"name":"Re: Dashboard Last Updated Date","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/397701#Comment_397701","dateInserted":"2023-09-29T16:19:19+00:00","insertUserID":167704,"insertUser":{"userID":167704,"name":"Jenn Moffett","title":"Director, PMO","url":"https:\/\/community.smartsheet.com\/profile\/Jenn%20Moffett","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-09-29T15:38:19+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,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-09-29T15:39:37+00:00","dateAnswered":"2023-09-29T14:10:25+00:00","acceptedAnswers":[{"commentID":397662,"body":"