+ Reply to Thread
Results 1 to 44 of 44

how can I sort text cells from right to left

  1. #1
    Registered User
    Join Date
    11-25-2023
    Location
    India
    MS-Off Ver
    2007
    Posts
    13

    how can I sort text cells from right to left

    Sir,

    I want to sort text cells from Right to left, please advise me.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,978

    Re: how can I sort text cells from right to left

    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    11-25-2023
    Location
    India
    MS-Off Ver
    2007
    Posts
    13

    Re: how can I sort text cells from right to left

    I am using 2007 version, is there smallest to largest sort function available ?

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,978

    Re: how can I sort text cells from right to left

    I don't know - I would assume so. I don't have that version, though - sorry.

  5. #5
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: how can I sort text cells from right to left

    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.

  6. #6
    Banned User!
    Join Date
    05-03-2022
    Location
    HumptyDoo, Australia
    MS-Off Ver
    365
    Posts
    101

    Re: how can I sort text cells from right to left

    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.

  7. #7
    Banned User!
    Join Date
    05-03-2022
    Location
    HumptyDoo, Australia
    MS-Off Ver
    365
    Posts
    101

    Re: how can I sort text cells from right to left

    Well????? Did that macro work for you?

  8. #8
    Registered User
    Join Date
    11-25-2023
    Location
    India
    MS-Off Ver
    2007
    Posts
    13

    Re: how can I sort text cells from right to left

    Sir,

    This macro did not work, any else way sir ?

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: how can I sort text cells from right to left

    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  10. #10
    Banned User!
    Join Date
    05-03-2022
    Location
    HumptyDoo, Australia
    MS-Off Ver
    365
    Posts
    101

    Re: how can I sort text cells from right to left

    Quote Originally Posted by vasdev View Post
    Sir,

    This macro did not work, any else way sir ?
    No. Macro 'did not work' is NEVER a valid response. You want help, you need to provide more.

  11. #11
    Registered User
    Join Date
    04-13-2022
    Location
    Kristianstad, Sweden
    MS-Off Ver
    2007/2016
    Posts
    21

    Re: how can I sort text cells from right to left

    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."

  12. #12
    Banned User!
    Join Date
    05-03-2022
    Location
    HumptyDoo, Australia
    MS-Off Ver
    365
    Posts
    101

    Re: how can I sort text cells from right to left

    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.

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: how can I sort text cells from right to left

    Unfortunatelt, until the OP provides us with a concrete example, this is all guesswork.

  14. #14
    Registered User
    Join Date
    11-25-2023
    Location
    India
    MS-Off Ver
    2007
    Posts
    13

    Re: how can I sort text cells from right to left

    Sorry Sir, I must have mistaken as I am new user. Trying again, hopefully the mentioned macro will work 100%.

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: how can I sort text cells from right to left

    Please supply a sample file as requested in Post 9!!!

  16. #16
    Banned User!
    Join Date
    05-03-2022
    Location
    HumptyDoo, Australia
    MS-Off Ver
    365
    Posts
    101

    Re: how can I sort text cells from right to left

    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?

  17. #17
    Registered User
    Join Date
    11-25-2023
    Location
    India
    MS-Off Ver
    2007
    Posts
    13

    Re: how can I sort text cells from right to left

    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).
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    11-25-2023
    Location
    India
    MS-Off Ver
    2007
    Posts
    13

    Re: how can I sort text cells from right to left

    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).
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    11-25-2023
    Location
    India
    MS-Off Ver
    2007
    Posts
    13

    Re: how can I sort text cells from right to left

    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
    Attached Files Attached Files

  20. #20
    Banned User!
    Join Date
    05-03-2022
    Location
    HumptyDoo, Australia
    MS-Off Ver
    365
    Posts
    101

    Re: how can I sort text cells from right to left

    Here you go;
    Attached Files Attached Files

  21. #21
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: how can I sort text cells from right to left

    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...
    Attached Files Attached Files

  22. #22
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,978

    Re: how can I sort text cells from right to left

    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.

  23. #23
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,005

    Re: how can I sort text cells from right to left

    Simplified steps,use last two words to sort.

    B1
    Please Login or Register  to view this content.
    C1
    Please Login or Register  to view this content.
    Both committed with Ctrl+Shift+Enter and copied down.
    Attached Files Attached Files

  24. #24
    Registered User
    Join Date
    11-25-2023
    Location
    India
    MS-Off Ver
    2007
    Posts
    13

    Re: how can I sort text cells from right to left

    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).
    Attached Files Attached Files

  25. #25
    Banned User!
    Join Date
    05-03-2022
    Location
    HumptyDoo, Australia
    MS-Off Ver
    365
    Posts
    101

    Re: how can I sort text cells from right to left

    Quote Originally Posted by AliGW View Post
    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.
    I did. See post #6

  26. #26
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,978

    Re: how can I sort text cells from right to left

    Thanks for clarifying.

  27. #27
    Banned User!
    Join Date
    05-03-2022
    Location
    HumptyDoo, Australia
    MS-Off Ver
    365
    Posts
    101

    Re: how can I sort text cells from right to left

    @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.

  28. #28
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: how can I sort text cells from right to left

    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: copy to clipboard
    Please Login or Register  to view this content.


    similar for descending. See file.
    Attached Files Attached Files

  29. #29
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: how can I sort text cells from right to left

    LoL. Ignore my post. I completely misinterpreted this one.

  30. #30
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,005

    Re: how can I sort text cells from right to left

    Without aggregate function, maybe use small and large.

    B1
    Please Login or Register  to view this content.
    C1
    Please Login or Register  to view this content.
    Both committed with Ctrl+Shift+Enter and copied down.

  31. #31
    Registered User
    Join Date
    11-25-2023
    Location
    India
    MS-Off Ver
    2007
    Posts
    13

    Re: how can I sort text cells from right to left

    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....

  32. #32
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: how can I sort text cells from right to left

    Who are you talking to?

  33. #33
    Registered User
    Join Date
    11-25-2023
    Location
    India
    MS-Off Ver
    2007
    Posts
    13

    Re: how can I sort text cells from right to left

    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...

  34. #34
    Registered User
    Join Date
    11-25-2023
    Location
    India
    MS-Off Ver
    2007
    Posts
    13

    Re: how can I sort text cells from right to left

    Thanks Sir.

  35. #35
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: how can I sort text cells from right to left

    WHICH of us are you talking to?????

  36. #36
    Registered User
    Join Date
    11-25-2023
    Location
    India
    MS-Off Ver
    2007
    Posts
    13

    Re: how can I sort text cells from right to left

    Thanks a lot Sir, I am using old version 2007, on upgrading to latest version, will try.

    Thanks and regards...

  37. #37
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: how can I sort text cells from right to left

    I give up...

  38. #38
    Registered User
    Join Date
    11-13-2022
    Location
    Amman - Jordan
    MS-Off Ver
    2016 Use at work 365 at Home
    Posts
    27

    Re: how can I sort text cells from right to left

    Quote Originally Posted by windknife View Post
    Without aggregate function, maybe use small and large.

    B1
    Please Login or Register  to view this content.
    C1
    Please Login or Register  to view this content.
    Both committed with Ctrl+Shift+Enter and copied down.
    Sir what shell i modifiy adjust your formula if i want insert rows above your for formula

  39. #39
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,005

    Re: how can I sort text cells from right to left

    If you insert n row, modify row() to row()-n.

  40. #40
    Registered User
    Join Date
    06-04-2018
    Location
    Europe
    MS-Off Ver
    Office365
    Posts
    78

    Re: how can I sort text cells from right to left

    ---------------------------------
    Last edited by Tommy90; 12-07-2023 at 06:42 AM.

  41. #41
    Registered User
    Join Date
    11-13-2022
    Location
    Amman - Jordan
    MS-Off Ver
    2016 Use at work 365 at Home
    Posts
    27

    Re: how can I sort text cells from right to left

    Quote Originally Posted by windknife View Post
    If you insert n row, modify row() to row()-n.
    Thank you for your time response Geniuses

  42. #42
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,005

    Re: how can I sort text cells from right to left

    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.

  43. #43
    Registered User
    Join Date
    11-25-2023
    Location
    India
    MS-Off Ver
    2007
    Posts
    13

    Re: how can I sort text cells from right to left

    Solved. Thanks a lot to everyone.

  44. #44
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,978

    Re: how can I sort text cells from right to left

    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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA Stop cells to cut of text in cell to the left
    By DeJans1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-20-2023, 03:48 AM
  2. Stop cells to cut of text in cell to the left
    By DeJans1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-14-2023, 01:56 AM
  3. Replies: 6
    Last Post: 06-26-2017, 09:04 PM
  4. [SOLVED] When a certain text is in cell, copy paste in cells left or right of the text
    By TAMMY32 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-28-2016, 05:23 PM
  5. [SOLVED] remove specific text from certain cells, then multiply the numerical value left by 0.001
    By jeffnoone in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-21-2014, 02:25 PM
  6. Sort based on values of cells to the left
    By okriskao in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-13-2009, 08:49 AM
  7. [SOLVED] Can you sort a column by text going right to left?
    By luvsdogz in forum Excel General
    Replies: 4
    Last Post: 12-08-2005, 12:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1