Note: The other languages of the website are Google-translated. Back to English

How to sort dynamic data in Microsoft Excel?

Let's say you are managing the storage data of a stationary shop in Excel, and you need to automatically sort the storage data when it changes. How do you sort the dynamic storages data automatically in Excel? This article will show you a tricky way to sort dynamic data in Excel, and keep the sorting update automatically when the original data changes at once.

Sort synamic data in Excel with formula


Sort synamic data in Excel with formula

1. Insert a new column at the beginning of the original data. Here I insert column No. before the original data as below screenshot shown:

2. Follow our example, enter formula =RANK(C2,C$2:C$6) in Cell A2 to sort original products by their storage, and press the Enter key.

3. Keep selecting cell A2, drag the Fill Handle down to cell A6 to get all rest numbers in No. column.

4: Copy the titles of the original data, and then paste them besides original table, such as E1:G1. In the Desired No. column, insert the sequence numbers same as the No. orders such as 1, 2, …. See screenshot:

5. Enter formula =VLOOKUP(E2,A$2:C$6,2,FALSE) into Cell F2, and press the Enter key.

This formula will look for the value of Desired NO. in the original table, and display the corresponding product name in the cell.

Note: If repeats or ties display in the Product column or Storage column, you’d better apply this function =IFERROR(VLOOKUP(E2,A$2:C$6,2,FALSE), VLOOKUP(E2,A$2:C$6,2,TRUE))

6. Keep selecting cell F2, drag the Fill Handle down to cell F6 to get all product names, And keep selecting range F2:F6, drag the Fill Handle right to range G2:G6 to get all storage numbers.

Then you will get a new storage table sorting in descend order by the storage as below screenshot shown:

Supposing your stationary shop purchases another 145 pens, and now you have 200 pens in total. Just modify the original table of pen's storage, you will see the new table is updated in a blink of eyes, see the following screen shot:


The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Comments (49)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi, I can do the same without Kutools and in your example iso changing the amount for pencils, you can add another line, repeat pencils and add the additional amount and my spreadsheet will display pencils only once (it does not matter how many pencil entries there are)with the total amount. Plain Excel without Macros, VB Code, Access, D Base, etc. I would love to show you.
Johann
This comment was minimized by the moderator on the site
I tried this and it worked as long as all of the ranked values are unique. If there is a tie in the ranking, the VLOOKUP will return #N/A. This creates a problem because I cannot ensure there will not be any ties in my ranking as the values change. In other words, if "Pencil" and "Notebook" are both equal to 80, then RANK returns 1,2,3,3,5. And since the values in the Desired No. field were mannually entered as 1,2,3,4,5, VLOOKUP will not find a "4".
SteveB90
This comment was minimized by the moderator on the site
Hi SteveB90, Thanks for your comment. The =VLOOKUP(E2,A$2:C$6,2,FALSE) will match the data exactly, so it goes wrong if ties happen. In this case, you can try the approximate matching function =IFERROR(VLOOKUP(E2,A$2:C$6,2,FALSE), VLOOKUP(E2,A$2:C$6,2,TRUE)), which work well if ties come out. And hope it works for you.
HelloKelly
This comment was minimized by the moderator on the site
Instead of just using '=RANK(C2,C$2:C$6)' in column A, you can use '=RANK(C2,C$2:C$6) + COUNTIF(C$2:C2, "="&C2)-1' This will go by the rank, but then count the number of duplicates that are already in the list. This will ensure that you get a unique ranking.
Kedirech
This comment was minimized by the moderator on the site
Thanks Kedirech..this solved my problem
Uttam Saini
This comment was minimized by the moderator on the site
Thanks Kedirech!!! This COUNTIF solved the tie issue!!
Daniel Alfano
This comment was minimized by the moderator on the site
Kedirech, thank you SOOOO much, this worked perfectly.
Thomas
This comment was minimized by the moderator on the site
Excellent Tip...was looking for some solution for this problem all over the internet. Finally found here It's amazing how people in different parts of the globe are having the similar requirement at the same time!!
Manjunath
This comment was minimized by the moderator on the site
thanks a lot, Kedirech, this really helps!
Yusrina
This comment was minimized by the moderator on the site
can you have multiple ranking columns in excel and use the sort function to be able to rank in numerical order
StayLens
This comment was minimized by the moderator on the site
hi just wanted to say thanks for this page! have been searching the web for a week and this page (plus Kedirech's comment) has solved it!! cheers!
Gaz
This comment was minimized by the moderator on the site
what if there are more than 2 repeats in storage column? it doesn't work well with the '=IFERROR(VLOOKUP(E2,A$2:C$6,2,FALSE), VLOOKUP(E2,A$2:C$6,2,TRUE))' method
Fanynn
This comment was minimized by the moderator on the site
Did you ever get an answer on this? I've got the same problem when I have 3 or more values that are the same.
Charles
This comment was minimized by the moderator on the site
Great help guys. thank you.
Mandla
This comment was minimized by the moderator on the site
Hi, I am using this to make a dynamic league ladder, is there anyway to have multiple teams have the same ranking. For example, if 5 teams have 4 points and 5 teams have 0 points, the vlookup will only lookup the first of each. This is the raw data: Pos. Team P W L Pts 1 Team 1 1 1 0 4 6 Team 2 1 0 1 0 1 Team 3 1 1 0 4 6 Team 4 1 0 1 0 1 Team 5 1 1 0 4 6 Team 6 1 0 1 0 1 Team 7 1 1 0 4 6 Team 8 1 0 1 0 1 Team 9 1 1 0 4 6 Team 10 1 0 1 0 This is the vlookup table of the table above: Pos. Team P W L Pts 1 Team 1 1 1 0 4 2 #N/A #N/A #N/A #N/A #N/A 3 #N/A #N/A #N/A #N/A #N/A 4 #N/A #N/A #N/A #N/A #N/A 5 #N/A #N/A #N/A #N/A #N/A 6 Team 2 1 0 1 0 7 #N/A #N/A #N/A #N/A #N/A 8 #N/A #N/A #N/A #N/A #N/A 9 #N/A #N/A #N/A #N/A #N/A 10 #N/A #N/A #N/A #N/A #N/A Please help! Thanks a million :D
Will
This comment was minimized by the moderator on the site
IM USING THIS FORMULA =IFERROR(VLOOKUP(I3,CALCULATIONS!I$2:K$7,2,FALSE),(VLOOKUP(I3,CALCULATIONS!I$2:K$7,2,TRUE))) Now I have a problem... If 2 or more people have the same points, excel repeats the name. What should I add in the formula to avoid repeated names when they have the same amount of points? Thank you
DIEGO MEDINA
This comment was minimized by the moderator on the site
hi guys, this page is really useful. I need an excel formula or vb code what works fine for problem. my problem is that i have a list of numeric range, lets say, 1 to 100 in ascending order in column A. I have the same numeric range in random order in column B and I have different scores in column C in random order. All i want is to sort the random range of column C with the same number against it in column C according to the ascending order of range in column A.I want to sort column B but along with scores in column C as well. for example, Column A Column B Column C 1 2 10 25 3 4 60 4 9 95 5 2 30 6 7 6 20 8 5 31 9 3 45 10 1 55 in column B, there are two digits (7 &8) missing. i just want that column B be sorted against each digit in column A, like 1 in front of 1 and 2 in front 2 and missing should remain blank in column B in front of 7 & 8 in column A. Column A Column B Column C 1 1 55 2 2 30 3 3 45 4 4 60 5 5 31 6 6 20 7 8 9 9 95 10 10 25 I hope i have complicated it a lot but plz somebody help me out.
Basit
This comment was minimized by the moderator on the site
#Basit - I would like to see a solution without vbasic or macros.
jays
This comment was minimized by the moderator on the site
#jays,- i would appreciate any solution with or without vbasic or excel formulas.
Basit
This comment was minimized by the moderator on the site
If the figures in A and B are always be going to be unique (no duplicate per column and each one in Coln B also appears in A) then it should be fairly easy.
jays
This comment was minimized by the moderator on the site
Numbers in a must be unique and those in b must also spat in a
jays
This comment was minimized by the moderator on the site
Thank you for this help. I have one problem. This Ranks things from largest to smallest. I need to do the opposite and rank them smallest to largest. How do I change this.
Jim101
This comment was minimized by the moderator on the site
[quote]Thank you for this help. I have one problem. This Ranks things from largest to smallest. I need to do the opposite and rank them smallest to largest. How do I change this.By Jim101[/quote] The rank function has an optional 3rd argument. By default it's set to order largest to smallest. But if you use 1 for the 3rd argument, RANK(C2,C$2:C$6,1), it will sort in the opposite order.
Kedirech
This comment was minimized by the moderator on the site
Hi I am trying to create a dart averages table, for multiple teams,so that each match when I enter data it automatically calculates on another page on the same sheet. Rank Name Pl W L 100+ 140+ 180 Av D/Av
Hepp
This comment was minimized by the moderator on the site
Hi I am finding the Above useful in 2007 however the Company I work for still only uses office 97 will this work in that. Kind Regards
Beast101za
This comment was minimized by the moderator on the site
Hi Help ,have you tried a pivot table?
jays
This comment was minimized by the moderator on the site
Thank You so much, it works and best partnered with Graphs!
Domz
This comment was minimized by the moderator on the site
This method can eliminate duplicates without a macro for cases like the example when integers or fixed decimals are used. Add a dummy column and make incremental changes to the data to be sorted. Then follow the same process as outlined using the modified data. Using the example make column I with the formula col C + col E * 0.01. Then, change col A to rank col I instead of col C. The rest is the same. Not perfect but might help. If there are lot of items then decrease the incremental multiplier enough that the max number of items being sorted * the multiplier remains insignificant compared to the data being sorted.
GernB
This comment was minimized by the moderator on the site
I need help.. I have been using vlookup in excel to look at two sheets (one sheet is from a manufacture, one sheet is from our retail sales software) which share a common vendor number in order to attach a UPC number from the manufacturer info sheet to the retail sales sheet which is then imported back in to our retail sales software. V Lookup errors all to often and I am not savy enough to know why so I was wondering if Kutools has a similar function to make my life easier. Again,in an attempt to clarify...Manufacture provided excel sheet contains a vendor number and a UPC number. second sheet has same vendor number and internal part number and I want a Kutool function that will compare vendor numbers and attach the UPC to the second sheet which will then be imported back into our system (using internal part number to "find" the item) Any help will be appreciated!! :-)
kevinbmfs
There are no comments posted here yet
Load More
Leave your comments
Posting as Guest
×
Rate this post:
0  Characters
Suggested Locations