Sir,
I want to sort text cells from Right to left, please advise me.
Sir,
I want to sort text cells from Right to left, please advise me.
Welcome to the forum.
Choose a smallest to largest sort.
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
NB: as a Moderator, I never accept friendship requests.
Forum Rules (updated August 2023): please read them here.
I am using 2007 version, is there smallest to largest sort function available ?
I don't know - I would assume so. I don't have that version, though - sorry.
Highlight the region you wish to sort. Then select Data > Sort > Options - one of the options is Sort Left to Right. Then you can select the direction of sort. either ascending or descending.
One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.
A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.
1. Select the text you want to sort Right to left
2. Run the macro below.
3. Sort the text however you want.
4. Run the macro again.
![]()
Please Login or Register to view this content.
Well????? Did that macro work for you?
Sir,
This macro did not work, any else way sir ?
This phrase is ambiguous: "sort text cells from Right to left". Please upload a SMALL file with raw data and expected answers...
Glenn
None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU
A simple way to sort text from left to right is what dflak writes.
"Highlight the region you wish to sort.
Then select Data > Sort > Options - one of the options is Sort Left to Right.
Then you can select the direction of sort. either ascending or descending."
This is not sorting text from right to left, it is sorting a row of data in either ascending or descending order.
The way I understand it is that he wants to sort text in some order (either ascending or descending) with the last letter of the text being the 'most important', then the second last letter etc.
That's what the macro I provided does anyway, but I lose interest when someone tells me a macro 'doesn't work' without providing an explanation of what they did, the results they got and why it is not what was expected.
Unfortunatelt, until the OP provides us with a concrete example, this is all guesswork.
Sorry Sir, I must have mistaken as I am new user. Trying again, hopefully the mentioned macro will work 100%.
Please supply a sample file as requested in Post 9!!!
As you have said you are going to run the macros again, here are a couple of big assumptions on my part.
1. You actually know how to add the macros to your workbook and execute them as per post #6?
2. Post #12 accurately describes your requirements?
Respected Sir, you understood correctly. I upload a small file containing text cells ending with a, b, c..... and want to sort this so that the result appears ending with a, b, c (ascending) and z, y, x (descending).
Respected Sir, macro recorded correctly but somewhere I might have mistaken. Uploading a small file, containing text cells and ending with a, b, c..... I want to sort these cells according to ending word a, b, c (ascending) and z, y, x... (descending).
Respected Sir, uploading a small file containing text cells ending with a, b, c and want to sort these the words ending with a, b, c (ascending) and z, x, y (descending). Regards
Here you go;
Finallly!
A sample. Now I know if the words are in a row/column and not all in a single cell.
=IFERROR(INDEX($A$1:$A$15,MATCH(LARGE(COUNTIF($A$1:$A$15,">="&$A$1:$A$15),ROWS(C$1:C1)),COUNTIF($A$1:$A$15,">="&$A$1:$A$15),0)),"")
You seem to be using an older version of Excel than me. So, please refer to the attached file. If the formulae are enclosed within a pair of { }, these are array formulae.
These are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.
You will know the array is active when you see the curly brackets { } appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.
Don't type the curly brackets yourself - it won't work...
Similar for descending order. See file. When you upgrade to O365, this becomes MUCH easier...
Administrative Note:
Gamechanger, in your post, please include formulae or code used in addition to providing a workbook (for the benefit of members unable to download attachments).
Thanks.
Simplified steps,use last two words to sort.
B1
C1![]()
Please Login or Register to view this content.
Both committed with Ctrl+Shift+Enter and copied down.![]()
Please Login or Register to view this content.
This is small file containing text cells ending with the character a, b, c,. I want to sort these cells ending with a, b, c (ascending) or z, y, x, (descending).
Thanks for clarifying.
@Glenn Kennedy. Your sample file is a simple ascending and descending sort! He said he wants to sort Right to Left.
@windknife. Not sure Aggregate exists in Excel 2007.
GameChanger... partially correct. I hadn't seen the expected answers - as they were not in the first sample file. However, they WERE in the second sample and are shown top-to-bottom, not left-to-right.
COUNTIF won't work with non-range arrays, so an alternative is needed.
Also an array formula:
Formula:
Please Login or Register to view this content.
similar for descending. See file.
LoL. Ignore my post. I completely misinterpreted this one.
Without aggregate function, maybe use small and large.
B1
C1![]()
Please Login or Register to view this content.
Both committed with Ctrl+Shift+Enter and copied down.![]()
Please Login or Register to view this content.
Thanks a lot Sir, I am using 2007 version when tried the excel stopped working. I have saved the instructions given by you, on upgrading the latest version, will try again.
Thanks once again.
Regards....
Who are you talking to?
Thanks a lot Sir. I am using old version 2007, when I tried, excel stopped working. On upgrading the latest version, will revert.
Thanks and Regards...
Thanks Sir.
WHICH of us are you talking to?????
Thanks a lot Sir, I am using old version 2007, on upgrading to latest version, will try.
Thanks and regards...
I give up...
If you insert n row, modify row() to row()-n.
---------------------------------
Last edited by Tommy90; 12-07-2023 at 06:42 AM.
You are welcome.
--------------------------------------
If that takes care of your original question, please click on "Thread Tools" from the menu link above and mark this thread as SOLVED.
Solved. Thanks a lot to everyone.
If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.
Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks