displaying numbers in a cell backwords

H

Hillary

i want to display some numbers in a few cells backwords
for example i want a cell that has 1234 in it to say 4321
with out changing it manually. i have a lot of cells that
i need to change is there any esier way?
 
D

daniels012

If you only have 4 numbers this is the easiest way!!


=RIGHT(B3,1)&MID(B3,3,1)&MID(B3,2,1)&MID(B3,1,1)

Hope that helps!

Michael:
 
D

daniels012

Actually after thinking about it! This will work even better!
You can use this with 6 numbers.
=MID(B3,6,1)&MID(B3,5,1)&MID(B3,4,1)&MID(B3,3,1)&MID(B3,2,1)&MID(B3,1,1)

You could go on and on with however many number you think you wil
have.

Hope this helps

Michae
 
D

David McRitchie

Since those are macro solutions anyway, seems the
following would be a lot shorter.

Function Reverse(cell As Range) As String
Reverse = strReverse(cell)
End Function
Function ReverseT(cell As Range) As String
ReverseT = strReverse(cell.Text)
End Function

A1: 1234
B1: =Reverse(A1) or =personal.xls!reverse(A1) displays 4321

If you want it as a number if it's not you get #VALUE!
of course you could change the code in the function, instead
B1: =value(reverse(A1))

If you have a lot of cells to change you could change them
inplace with a macro based on the selection.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top