+ Reply to Thread
Results 1 to 43 of 43

Custom Sorting of Lists to be Data Merged

  1. #1
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Talking Custom Sorting of Lists to be Data Merged

    Hi all.
    Hope everybody is doing well.
    Here is my quandry...
    I receive room number/room names from the architects that need to be merged into my design application (InDesign, Flexi Design).
    These lists typically are all over the place as far as sequential numbering goes.
    And many times there are over 1000 rows in the list.
    Here is a quick example...

    10000 STORAGE
    10001 SOILED/ DECONTAM WORK AREA
    9999 WORK AREA
    8888 STORAGE
    6987 ELEVATOR CONTROL ROOM
    12000 STERILE STORAGE
    12000A BREAKDOWN
    12000B STERILE STORAGE
    6987B STERILE STORAGE
    6987A PREP AND PACK
    6987C PREP AND PACK
    8880 PREP AND PACK
    15000 PREP AND PACK
    10000B STORAGE
    10001C WORK AREA


    How would I sort the list to keep any value with a suffix (1000A ,1000B, 1000C etc) in sequential order?
    Here is the result after sorting low to high, which does not help me much.

    6987 ELEVATOR CONTROL ROOM
    8880 PREP AND PACK
    8888 STORAGE
    9999 WORK AREA
    10000 STORAGE
    10001 SOILED/ DECONTAM WORK AREA
    12000 STERILE STORAGE
    15000 PREP AND PACK
    10000B STORAGE
    10001C WORK AREA
    12000A BREAKDOWN
    12000B STERILE STORAGE
    6987A PREP AND PACK
    6987B STERILE STORAGE
    6987C PREP AND PACK

    I also am looking for a macro to insert line breaks after the words in the room names based on how wide my sign is...
    We use 6", 9" & 12" signs.

    Please see attached for more detailed info.
    Thanks for your assistance!
    -KD
    Attached Files Attached Files

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Custom Sorting of Lists to be Data Merged

    Change A column format to text then sort
    You've there mixed format (numbers and text) so it is sorted differently

  3. #3
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Custom Sorting of Lists to be Data Merged

    Hey Sandy.
    Sorry, formatting to text doesn't work for me.
    Here is the result...

    6987
    8880
    8888
    9999
    10000
    10001
    12000
    15000
    10000B
    10001C
    12000A
    12000B
    6987A
    6987B
    6987C

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Custom Sorting of Lists to be Data Merged

    what result should be in your opinion?

    something like this? which one
    Please Login or Register  to view this content.
    Last edited by sandy666; 07-16-2017 at 11:33 PM.

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Custom Sorting of Lists to be Data Merged

    Maybe something like this?

    Row\Col
    A
    1
    12000A BREAKDOWN
    2
    6987A PREP AND PACK
    3
    10000B STORAGE
    4
    12000B STERILE STORAGE
    5
    6987B STERILE STORAGE
    6
    10001C WORK AREA
    7
    6987C PREP AND PACK
    8
    10000 STORAGE
    9
    10001 SOILED/ DECONTAM WORK AREA
    10
    12000 STERILE STORAGE
    11
    15000 PREP AND PACK
    12
    6987 ELEVATOR CONTROL ROOM
    13
    8880 PREP AND PACK
    14
    8888 STORAGE
    15
    9999 WORK AREA
    Dave

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Custom Sorting of Lists to be Data Merged

    Or this.

    Row\Col
    A
    1
    6987A PREP AND PACK
    2
    6987B STERILE STORAGE
    3
    6987C PREP AND PACK
    4
    10000B STORAGE
    5
    10001C WORK AREA
    6
    12000A BREAKDOWN
    7
    12000B STERILE STORAGE
    8
    10000 STORAGE
    9
    10001 SOILED/ DECONTAM WORK AREA
    10
    12000 STERILE STORAGE
    11
    15000 PREP AND PACK
    12
    6987 ELEVATOR CONTROL ROOM
    13
    8880 PREP AND PACK
    14
    8888 STORAGE
    15
    9999 WORK AREA

  7. #7
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Custom Sorting of Lists to be Data Merged

    Sort1 is correct. How did you do it?

  8. #8
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Custom Sorting of Lists to be Data Merged

    Which one "is correct" ?

    ups, I overlooked "1"

    I used:
    =--IF(ISTEXT(A1),MID(A1,1,LEN(A1)-1),A1)
    =IF(ISTEXT(A1),RIGHT(A1,1),"")

    or

    =IFERROR(--MID(A20,1,SEARCH(" ",A20)-1),MID(A20,1,SEARCH(" ",A20)-1))
    =--IF(ISTEXT(B20),MID(B20,1,LEN(B20)-1),B20)
    =IF(ISTEXT(B20),RIGHT(B20,1),"")

    see att.
    Last edited by sandy666; 07-17-2017 at 07:40 AM.

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Custom Sorting of Lists to be Data Merged

    sandy what if you use for 1st sort key formula.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and 2nd sort key

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Row\Col
    A
    B
    C
    1
    Rooms KeyA KeyB
    2
    6987 ELEVATOR CONTROL ROOM
    6987
    3
    6987A PREP AND PACK
    6987
    A
    4
    6987B STERILE STORAGE
    6987
    B
    5
    6987C PREP AND PACK
    6987
    C
    6
    8880 PREP AND PACK
    8880
    7
    8888 STORAGE
    8888
    8
    9999 WORK AREA
    9999
    9
    10000 STORAGE
    10000
    10
    10000B STORAGE
    10000
    B
    11
    10001 SOILED/ DECONTAM WORK AREA
    10001
    12
    10001C WORK AREA
    10001
    C
    13
    12000 STERILE STORAGE
    12000
    14
    12000A BREAKDOWN
    12000
    A
    15
    12000B STERILE STORAGE
    12000
    B
    16
    15000 PREP AND PACK
    15000

  10. #10
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Custom Sorting of Lists to be Data Merged

    Dave,
    Each method is good for achieving the correct result

  11. #11
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Custom Sorting of Lists to be Data Merged

    Hey guys...
    Thanks for the prompt response(s)!
    Can't seem to get either method to work, but it is late and can barely keep the old eyes open...
    Will give it a shot tomorrow.
    Appreciate y'all's help.
    =KD

  12. #12
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Custom Sorting of Lists to be Data Merged

    Quote Originally Posted by sandy666 View Post
    Dave,
    Each method is good for achieving the correct result
    Yes of course. Thought it might be of interest re: the sort keys formulas.

  13. #13
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Custom Sorting of Lists to be Data Merged

    Quote Originally Posted by FlameRetired View Post
    Yes of course. Thought it might be of interest re: the sort keys formulas.

    It is more subtle than mine

  14. #14
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Unhappy Re: Custom Sorting of Lists to be Data Merged

    Hey Guys.
    Still having trouble getting either of these methods to work...
    Don't know what I am doing wrong, thought I was better than this.


    Here are the steps I took with Sandy's formula.
    What in the world am I doing wrong.
    Last edited by kevindowney; 07-18-2017 at 09:08 PM. Reason: removed images

  15. #15
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Custom Sorting of Lists to be Data Merged

    And here is the final result...
    HELP!
    Thanks.

    Result.png

  16. #16
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Custom Sorting of Lists to be Data Merged

    Edit your post, go Advanced then Manage Attachments and remove all pictures but add example excel file

    btw, if in formula is A2 you should insert formula to C2 not C1 or change A2 to A1 in formula if your data start from A1

    Since when do you deal with Excel?
    Last edited by sandy666; 07-18-2017 at 07:51 PM.

  17. #17
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Custom Sorting of Lists to be Data Merged

    I do believe you may have helped me in the past....
    worked on a couple data merge applications, complex pricing worksheets...
    Anyway, thanks for the tip, I will try again.
    Did you want to see any of those images?
    I have removed them all.

  18. #18
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Custom Sorting of Lists to be Data Merged

    I'd like to know if it works for you. That's all
    Attached Files Attached Files
    Last edited by sandy666; 07-18-2017 at 09:23 PM. Reason: file added

  19. #19
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Custom Sorting of Lists to be Data Merged

    Still can't get to work.
    When I paste the formula in formula bar for cell "C1" I get a return of "10000" (the value of "A1").
    Sorting 2 levels seem to make no difference.
    Attached is a new sheet with the formulas applied.
    See if you can see where I am going wrong.
    Thanks sandy
    Attached Files Attached Files

  20. #20
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Custom Sorting of Lists to be Data Merged

    change ALL A2 to A1 and try again

    your formula
    =--IF(ISTEXT(A1),MID(A1,1,LEN(A2)-1),A1)
    should be
    =--IF(ISTEXT(A1),MID(A1,1,LEN(A1)-1),A1)
    then in D1 use second formula
    =IF(ISTEXT(A1),RIGHT(A1,1),"")

    both drag down

    or see attached file from post #18

    If that takes care of your original question, please click on Add Reputtion (bottom left corner of the post of the person(s) who helped you)
    then select Thread Tools from the menu (top right corner of your thread) and mark this thread as SOLVED. Thanks.
    Last edited by sandy666; 07-18-2017 at 09:39 PM.

  21. #21
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Custom Sorting of Lists to be Data Merged

    It worked! Thanks!
    DUH!Didn't recognize the "both drag down"...

    Now, the both drag down part... What if my table has 1800+ rows, which is not uncommon.
    Is there a way to do that quicker and more accurately?
    And now with this longer sheet I am getting #VALUE Errors on the last 9 rows.
    See attached for a sheet with 593 rows.
    Attached Files Attached Files

  22. #22
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Custom Sorting of Lists to be Data Merged

    I see it will be a long time

    I'll try step by step

    Your data is in range (with example) A1:B15
    You need divide text from A1 (A2, A3,...etc) to a number and text
    First formula extract numbers from A1, second formula extract letters (if any)
    so
    first formula with correct cell should be in C1
    =--IF(ISTEXT(A1),MID(A1,1,LEN(A1)-1),A1)
    second formula should be in D1
    =IF(ISTEXT(A1),RIGHT(A1,1),"")

    now select C1 and D1 and both drag down to the end of your data (here:to row 15)

    Now select entire data A1:D15
    go to the ribbon
    Data
    Sort
    first level Sort by C column
    add second level Sort by D column

    hope it will help

  23. #23
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Custom Sorting of Lists to be Data Merged

    I see.... Letter preceding a number.
    Need to modify the formula in F1

  24. #24
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Custom Sorting of Lists to be Data Merged

    haha i was thinking it will be longer

    you got #VALUE error because you have letter on the front of text not on the end

    we are working on your example
    you should show ALL possible values not only some from the begining

    you should define how you want these values to sort ( eg. C263, C337, or C337A etc )

    create example excel file with all kind of data (not all data ) and show manually how you want these data to be sorted
    Last edited by sandy666; 07-18-2017 at 10:08 PM.

  25. #25
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Custom Sorting of Lists to be Data Merged

    Yes I got it to work and I now understand HOW it works...
    Let me see if I can figure out how to fix the rows with letters first then numbers.
    Thank you kindly!
    I will get back with you with the results.

    I have one more request which I will post to a new thread.

  26. #26
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Custom Sorting of Lists to be Data Merged

    No problem
    but first you should define HOW it should be sorted with all kinds of data

  27. #27
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Custom Sorting of Lists to be Data Merged

    Sort Rooms with Letter Prefixes (A & Lowest Number to Z & Highest Number)
    Example...
    A100
    B100
    B900
    C200
    C200A
    C200B
    Z10000

    I would like to display those at the bottom of the sheet.

  28. #28
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Custom Sorting of Lists to be Data Merged

    Or in this specific case..

    C263 DISH ROOM
    C337 ADMIN OFFICES
    C337A ADMIN OFFICES
    C358 READING SUITE
    C358 READING SUITE
    C513 STAFF ONLY
    C513 STAFF ONLY
    C514B STAFF ONLY
    C514B STAFF ONLY

  29. #29
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Custom Sorting of Lists to be Data Merged

    No, how it should be sorted (all not parts)
    Please Login or Register  to view this content.
    I need to know pattern.
    Last edited by sandy666; 07-18-2017 at 10:39 PM.

  30. #30
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Custom Sorting of Lists to be Data Merged

    Pattern would be numerical lowest to highest.
    Then after the highest number (at the bottom) start values with letter in front (sort A-Z, lowest to highest)...
    Like this...
    1000
    2000
    3000
    5000
    A100
    B100
    B900
    C200
    C200A
    C200B
    Z10000

    See attached for workbook as example.
    Attached Files Attached Files

  31. #31
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Custom Sorting of Lists to be Data Merged

    Ok, see attached file
    select entire data and use Data - Sort - levels (for three columns: C, D, E)

    formula in C1 is array entered
    both next - normal
    drag all three formulas down to the end of the data
    Attached Files Attached Files

  32. #32
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Custom Sorting of Lists to be Data Merged

    Not quite.
    Here is the outcome for me...
    Maybe I did something wrong.

    Please Login or Register  to view this content.

    And this is the expected result...


    Please Login or Register  to view this content.


    Thanks much.
    Gonna call it a day.
    Will post tomorrow with final request for this thread.
    Check out the attached PDF for the example of what I am trying to accomplish, merging the sorted data to the sign application.
    I need some help with line breaks for long room names.

    Cheers!
    Attached Files Attached Files
    Last edited by kevindowney; 07-18-2017 at 11:11 PM.

  33. #33
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Custom Sorting of Lists to be Data Merged

    sorry , I don't understand what is in pdf file
    I prefer excel file and clear explained what you want to achieve

    if you want remove breaks (carriage return)
    select range
    Ctrl+H
    in Find click inside then: Ctrl+J
    in Replace click inside then: space (space bar)
    replace all

    sorry, my english going to be worse, 5am here

    or if opposite - use Wrap Text
    Last edited by sandy666; 07-18-2017 at 11:18 PM.

  34. #34
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Custom Sorting of Lists to be Data Merged

    OK. I understand.
    Right now I need the last example to come out like this...

    Please Login or Register  to view this content.
    Good nite & thanks!

  35. #35
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Custom Sorting of Lists to be Data Merged

    You got all formulas what you need (with your examples)
    Now you should try with different levels of sort (and move levels from dow to top or vice versa) - this is your job.
    I can give you example but how it should be sorted , you know only

    levels.jpg

    you've only 3! possibilities =FACT(3)

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    With new problem - start new thread
    Last edited by sandy666; 07-18-2017 at 11:35 PM.

  36. #36
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Custom Sorting of Lists to be Data Merged



    Got it to work!
    Thanks so much.
    I see that the result depends on the order of sorting levels.

    One more question...
    When copy --> paste the formulas to a new sheet, the value for A1 (1502) in the cell with the array formula is not formatted correctly...
    Comes back as $2.00, when I change format to General it returns as "2".
    How come?
    See attached please for example.
    Attached Files Attached Files

  37. #37
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Custom Sorting of Lists to be Data Merged


  38. #38
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Custom Sorting of Lists to be Data Merged

    That is messed up!
    Fix didn't work for this.
    Keeps going back to the wrong format!
    Any ideas?
    I am running 2010

  39. #39
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Custom Sorting of Lists to be Data Merged

    Did you read there this is like a "bug"? No golden advice. Google is your friend
    You can try paste formula into formula bar not directly into the cell (cell should be in General first)
    And I should say: One Problem - One Thread - create new thread with your problem
    Last edited by sandy666; 07-19-2017 at 10:19 PM.

  40. #40
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Custom Sorting of Lists to be Data Merged

    Yes I read that. I have never had this problem before.
    Never.
    I will mark this thread as solved.
    Not your fault Microsoft BS.
    Thank you sandy.
    -KD

  41. #41
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Custom Sorting of Lists to be Data Merged

    You're right - call MS

  42. #42
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Custom Sorting of Lists to be Data Merged

    yeah right.
    HAHAHA

  43. #43
    Registered User
    Join Date
    10-09-2013
    Location
    Tennessee
    MS-Off Ver
    2010
    Posts
    59

    Re: Custom Sorting of Lists to be Data Merged

    Here's what I am doing wrong...
    When exiting the cell, remember to do it with CTRL+SHIFT+ENTER
    Now works like a charm.
    Appreciate your help on this~
    Have a great day!
    -KD

+ 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. [SOLVED] Custom Data Validation Lists
    By vadrev in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-27-2014, 04:21 PM
  2. [SOLVED] Formula or sorting method to pull apart merged data
    By IronCladRooster in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-17-2013, 04:46 PM
  3. Excel 2007 : Sorting data that is split with merged cells
    By WaldoBurger in forum Excel General
    Replies: 3
    Last Post: 04-07-2010, 08:02 AM
  4. Sorting data in merged & Ummerged cells
    By goodles in forum Excel General
    Replies: 1
    Last Post: 07-27-2009, 01:48 PM
  5. Sorting Data with Unevenly Merged Rows
    By gatorchomp85 in forum Excel General
    Replies: 1
    Last Post: 04-23-2009, 03:21 PM
  6. Sorting by Custom Lists in Excel 2007
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 11-19-2007, 12:25 PM
  7. Merged left hand column prevents sorting data
    By ND001 in forum Excel General
    Replies: 4
    Last Post: 10-01-2007, 04:26 PM
  8. Custom Lists in Excel where data contains a Comma....
    By konquistador in forum Excel General
    Replies: 5
    Last Post: 03-15-2007, 09:36 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