Rearrange Data From Last Row to First Row

kumara_faith

Well-known Member
Joined
Aug 19, 2006
Messages
928
Office Version
  1. 365
Hi ,

I have the data as follows:

Book2
ABCDEFG
1DateOpenHighLowClose*Adj Close**Volume
2Sep 17, 20214,469.744,471.524,427.764,432.994,432.995,622,210,000
3Sep 16, 20214,477.094,485.874,443.804,473.754,473.753,321,030,000
4Sep 15, 20214,447.494,486.874,438.374,480.704,480.703,154,760,000
5Sep 14, 20214,479.334,485.684,435.464,443.054,443.052,568,730,000
6Sep 13, 20214,474.814,492.994,445.704,468.734,468.733,096,390,000
7Sep 10, 20214,506.924,520.474,457.664,458.584,458.582,851,140,000
8Sep 09, 20214,513.024,529.904,492.074,493.284,493.283,035,300,000
9Sep 08, 20214,518.094,521.794,493.954,514.074,514.072,808,480,000
10Sep 07, 20214,535.384,535.384,513.004,520.034,520.033,098,870,000
11Sep 03, 20214,532.424,541.454,521.304,535.434,535.432,609,660,000
12Sep 02, 20214,534.484,545.854,524.664,536.954,536.952,897,010,000
Sheet3


I need the data to be arranged from the earliest date to the current date. The data is from Year 2010 to Year 2021. The format of the data is Date. But when I try to use sort to sort this from year 2010 to year 2021, it shows as below which is inaccurate

Book2
ABCDEFG
1DateOpenHighLowClose*Adj Close**Volume
2Apr 01, 20101,171.231,181.431,170.691,178.101,178.104,006,870,000
3Apr 01, 20111,329.481,337.851,328.891,332.411,332.414,223,740,000
4Apr 01, 20131,569.181,570.571,558.471,562.171,562.172,753,110,000
5Apr 01, 20141,873.961,885.841,873.961,885.521,885.523,336,190,000
6Apr 01, 20152,067.632,067.632,048.382,059.692,059.693,543,270,000
7Apr 01, 20162,056.622,075.072,043.982,072.782,072.783,749,990,000
8Apr 01, 20192,848.632,869.402,848.632,867.192,867.193,500,760,000
9Apr 01, 20202,498.082,522.752,447.492,470.502,470.505,947,900,000
10Apr 01, 20213,992.784,020.633,992.784,019.874,019.874,151,240,000
11Apr 02, 20121,408.471,422.381,404.461,419.041,419.043,572,010,000
Sheet3


Is there anyway I can use a formula to populate the data from the last row i.e from year 2010 to year year 2021? Basically to sort the data from year 2010 to year 2021. Appreciate all the help.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi -

I suspect based on the result of the sort that Excel is treating the contents of column A, as text rather than as a 'true' date. Might be worth converting these '=datevalue(a2)' (which converts a date held as text into a 'true' date (e.g. a number which then can be displayed as a date)), if that were to work then you could either sort by this 'new' column or copy/paste special and put the value of the formula back into A2, etc

If that still doesn't do what you need how about posting a sample via the utility 'xl2bb' so I can actually see how Excel is holding the content of A2, etc?
 
Upvote 0
Hi ,

I tried that and it returned as #value.

Here is a link to the file. Hope you can access the file.

 
Upvote 0
Hi

having downloaded the file, the content in A is 'just' text, so we need to convert it to a date so excel will then sort it correctly, so if you insert a new column in front of the current B, and then enter the formula of

Excel Formula:
=DATEVALUE(MID(A2,5,2) & " " & LEFT(A2,3) & " " & RIGHT(A2,4))
--- into B2 (and the rest of B)
you can then either sort this column or copy and paste the values back into A (and then obviously delete the new B column)
 
Last edited by a moderator:
Upvote 0
Solution
Hi ,

When I try to enter the formula, it is showing the following error:

1632044669643.png
 
Upvote 0
Hi,

My apologies. Pasted the formula wrongly. That worked. Thank you for your valuable time and patience. Have a great day. ?
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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