ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how do you reverse the orders of numbers? (https://www.excelbanter.com/excel-discussion-misc-queries/111866-how-do-you-reverse-orders-numbers.html)

JohnB

how do you reverse the orders of numbers?
 
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.

Pete_UK

how do you reverse the orders of numbers?
 
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)&M ID(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

JohnB wrote:
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.



Kevin B

how do you reverse the orders of numbers?
 
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.
--
Kevin Backmann


"JohnB" wrote:

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.


T Kirtley

how do you reverse the orders of numbers?
 
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

"JohnB" wrote:

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.



All times are GMT +1. The time now is 08:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com