how do you reverse the orders of numbers?

J

JohnB

I have a list of data and i need to reverse the order of the numbers..for
example
46183
29830
50784
49774
22199

needs to be
38164
03892
48705
47794
99122

Please help.
Thank you in advance.
 
P

Pete_UK

I see you will end up with leading zeros, and you presumably want to
keep these. If your first number is in A1 and is five digits as shown,
then enter this in B1:

=MID(A1,5,1)&MID(A1,4,1)&MID(A1,3,1)&MID(A1,2,1)&MID(A1,1,1)

You could use RIGHT in the first expression and LEFT in the final
expression, but this makes it easier for you to see how to cope with 6
or 7 digit numbers etc.

The formula can be copied down for as many numbers as you have, and
leading zeros will be preserved as you will end up with a text value
that looks like a number.

Hope this helps.

Pete
 
K

Kevin B

Sort descending. Select the column of number and on the standard toolbar
click the button that has a Z/A with a down arrow to sort descending. The
A/Z with a down arrow is your sort ascending button.
 
T

T Kirtley

Excel has no function to reverse text, but a simple function like the
following will use the vba function to reverse text in Excel.

Function ReverseTxt(text)
ReverseTxt= StrReverse(text)
End Function

If you put this function in a module you can use it like any other Excel
function, so if you have a value of 46183 in cell A1 then a formula of
=ReverseTxt(A1) will return 38164

HTH,

TK
 
Top