Auto sorting data in Excel

echomakr

Board Regular
Joined
Apr 20, 2008
Messages
65
I have a spreadsheet that is tied to real time prices that are constantly changing. Is there a way to make the spreadsheet sort real time based on the changing prices column?

Or, is there a way to sort the prices with a macro button?

Thanks for any help.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi,

This example might help. Set up a spreadsheet as follows:
  • In cells A2 to A11 enter the stock names/symbols.
  • In cells B2 to B11 enter sample prices (these would get updated in real time). You could enter =RAND() in this column to simulate prices for testing
  • In cells C2 to C11 enter another characteristic e.g. P/E ratio
  • In cell D2 enter the formula =RANK($B2,$B$2:$B$11)+COUNTIF($B$2:$B2,$B2)-1 - this assigns ranks the prices (without repeats)
  • In cell E2 enter the formula =INDEX($A$2:$C$11,MATCH(SMALL($D$2:$D$11,ROWS($D$2:$D2)),$D$2:$D$11,0),COLUMNS($O$14:O$14)) and drag this across to G2 and then down to G11
  • Column E should now have a list of stocks sorted by price (highest first), column F should have the associated price and column G should have the associated P/E ratio
The following resources are very useful:
http://www.mrexcel.com/td0067.html - ranking without repeats
http://chandoo.org/wp/2008/10/22/sorting-text-in-excel-using-formulas/ - sorting text (this isn't used in the example but could be incorporated depending on your needs)
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,789
Members
452,942
Latest member
VijayNewtoExcel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top