+ Reply to Thread
Results 1 to 3 of 3

Thread: Sorting by the last two digits with a twist

  1. #1
    Registered User
    Join Date
    11-22-2011
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    2

    Unhappy Sorting by the last two digits with a twist

    Hello Everyone,

    Through this forum I learned how to sort our case numbers by the last two digits:
    =value(right(A1,2)) However, some of our cases look like this 1110056425-01. The "-01" means nothing for my sorting purpose. I need to sort by the last two digits prior to the "-01" in this example I'd need to sort by the "25". I couldn't figure it out. Help please.
    Last edited by MiriBella; 11-22-2011 at 03:56 PM.

  2. #2
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: Sorting by the last two digits with a twist

    try:

    =RIGHT(LEFT(A1,FIND("-",A1&"-")-1),2)+0

    this should work for both items with the -01 and items with no dashes

    the +0 eliminates need for VALUE() function.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    11-22-2011
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Sorting by the last two digits with a twist

    It worked, it worked!!!!! Oh my goodness, you've saved us soooo much footwork! I think I heart you. Thanks again!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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