function for reversing data in cell?

Andrew70

New Member
Joined
Apr 8, 2002
Messages
30
I think this is one of those yes or no questions.

Is there an excel function that will take the data in a cell and reverse it for me?

For example, if cell A1 contains the text 'AB CD EF', is there a function that would enable me to output 'FE DC BA' in cell B1?

I did look at trying to cobble something together with the MID and RIGHT commands but I couldn't make it work.

I'm afraid my knowledge only extends to ordinary formulas so array formula solutions or VB solutions wouldn't be of any use to me.

Thanks,
Andrew.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Are all of the values of the form "XX XX XX" (with spaces between three sets of two characters)?

If so, B1 =RIGHT(A1)&MID(A1,7,1)&MID(A1,6,1)&MID(A1,5,1)&MID(A1,4,1)&MID(A1,3,1)&MID(A1,2,1)&LEFT(A1)
 
Upvote 0
No, unfortunately the character strings are variable in length and the position and number of spaces is also variable.
 
Upvote 0
UDF formula:


Function Backwards$(aname$)
Temp$ = ""
For i = Len(aname$) To 1 Step -1
Temp$ = Temp$ + Mid$(aname$, i, 1)
Next i
Backwards$ = Temp$
End Function

Regards
Pekka

PS. In Excel

1. press Alt +F11, VBA window opens
2. click Insert -> Module
3. copy and paste the code into module window
4. press Alt+F11 to go back to worksheet.
5. You are done

Now you can input the formula from your formula list.
 
Upvote 0
Thank you for the reply Pekavee but how should this formula be entered?
I only know how to use formulas of the style that Oaktree suggested.
 
Upvote 0
I am interesting in your code. I copy it to Macro but it never works. What is aname$?
Thanks.
Dennis
 
Upvote 0
aname is just a name for the formula.

Did you copy and paste the code from here to your VBA module window.

It should work. After inserting the code you should see the formula in your formula list when you are adding a formula into a cell.
It is not a macro, it is user defined formula and that is why you can not see it in the macro list.

Pekka
 
Upvote 0
Sadly I do not know how to use VB so I cannot use that solution.
I have also looked for the morefunc add-in but none of the websites I have visted show either a TEXTREVERSE or REVERSETEXT function included in that add-in. Was it removed? I think that would have been ideal if it worked like an ordinary formula function.
 
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,974
Members
448,537
Latest member
Et_Cetera

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