+ Reply to Thread
Results 1 to 11 of 11

Sorting Issue

  1. #1
    Registered User
    Join Date
    02-26-2020
    Location
    Texas
    MS-Off Ver
    365
    Posts
    37

    Sorting Issue

    Scenario -

    On one sheet, I have a user inputting data (in my case, exhibits).
    The user is not in control of naming conventions.
    It is strictly a record of verbal statements by clients.
    duplicates are not abnormal.

    Each client has different preferences and sometimes they can be illogical.
    They may use alpha or they may use numeric or they may use a combination of both.
    (i.e. they may simply list them as 1, 2, 3, etc.....or a, b, c, etc....BUT....at some point, they may go 1a, 1b, 1c, and then go to 2. Or they may go a1, a2, a3....before they go on to b).

    I take these responses and bring them to a hidden page via VBA where the time of occurrence is logged.
    Then, I list them out in a single column (on the same page).
    I then use an array formula to extract unique values (remove the duplicates and ignore blanks).

    From here, I want to sort the results (for further - future user input).
    I had been using an array formula
    Please Login or Register  to view this content.
    This worked fine for numeric but it is ignores alpha.
    Suggestions would be appreciated.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Sorting Issue

    Try:
    Please Login or Register  to view this content.
    Confirmed with Ctrl-shift-enter.
    It marks $P$418:$P$517 where is occupied with Text or number, then extract them.
    Quang PT

  3. #3
    Registered User
    Join Date
    02-26-2020
    Location
    Texas
    MS-Off Ver
    365
    Posts
    37

    Re: Sorting Issue

    I get an error

    "You've entered too few arguments for this function"

    I'll play with it in the morning.

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Sorting Issue

    Try the following modification: =IFERROR(INDEX($P$418:$P$517,SMALL(IF($P$418:$P$517<>"",ROW($P$418:P418)-MIN(ROW($P$418:$P$517))+1),""),ROW(1:1)),"")
    Remember to activate by simultaneously pressing the Ctrl, Shift and Enter keys.
    If this doesn't do what you want then it may help if you utilize the instructions in the banner at the top of the page and upload a sample workbook.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Registered User
    Join Date
    02-26-2020
    Location
    Texas
    MS-Off Ver
    365
    Posts
    37

    Re: Sorting Issue

    Sorry about the delay. Been on the road.
    Had to strip this down to eliminate a lot of info.
    will try to upload.
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Sorting Issue

    This proposal employs four helper columns (T:W) which may be moved and/or hidden for aesthetic purposes.
    Column T identifies alpha entries using: =IF(CODE(Q7)>=97,CODE(Q7))
    Column U identifies alphanumeric entries using: =IF(AND(ISNUMBER(VALUE(LEFT(Q7))),CODE(RIGHT(Q7))>=97),SUM(122,VALUE(LEFT(Q7,LEN(Q7)-1))*CODE(RIGHT(Q7))-96))
    Column V lists unsorted values using: =SUM(Q7,T7:U7)
    Column W lists sorted values using: =SMALL(V$7:V$36,ROWS(A$1:A1))
    The formula for column S is: =INDEX(Q$7:Q$36,MATCH(W7,V$7:V$36,0))
    Let us know if you have any questions.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-26-2020
    Location
    Texas
    MS-Off Ver
    365
    Posts
    37

    Re: Sorting Issue

    These calcs are all hidden from user view so aesthetics is no real concern.
    I will try in incorporate today as I will be working from home the next couple of weeks.
    It appears that this is just what the doctor ordered.
    Thanks for responding.

    Regards,
    KT

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Sorting Issue

    You're Welcome and thank you for the feedback. If this works for your actual data, please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

  9. #9
    Registered User
    Join Date
    02-26-2020
    Location
    Texas
    MS-Off Ver
    365
    Posts
    37

    Re: Sorting Issue

    It just dawned on me.....
    And I certainly did not mean to throw a wrench into this......

    When a document is referenced using a alpha-numeric, it is usually a combo between numeric and alpha-numeric

    OR

    it is a combo of alpha and alpha-numeric.


    Examples:

    1
    2
    3 (a)
    3b
    3c
    4
    5
    etc......

    OR

    a
    b
    c
    d (1)
    d2
    d3
    e
    f
    g
    etc.......

    I don't know if that is feasible but it would go a long way in keeping the user from making a mistake.

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Sorting Issue

    As to the example at the top, modify the formula in column U so that it reads: =IF(AND(ISNUMBER(VALUE(LEFT(Q7))),CODE(RIGHT(Q7))>=97),SUM(VALUE(LEFT(Q7,LEN(Q7)-1)),0.01*(CODE(RIGHT(Q7))-96)))
    looking at the example on the bottom, it will possibly need to be solved separately. I'll address that proposed solution in another post.
    Let us know if you have any questions.
    Attached Files Attached Files

  11. #11
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Sorting Issue

    As to the example on the bottom:
    Modify the formula in column T to read: =IF(Q7="","",IF(CODE(LEFT(Q7))>=97,SUM(CODE(LEFT(Q7)),IFERROR(VALUE(RIGHT(Q7,LEN(Q7)-1))*0.01,0))))
    The formula in column V to read: =IF(Q7="","",SUM(T7:U7))
    The formulas in columns S and U will also need to be prefixed using: =IF(Q7="","",...
    Let us know if you have any questions.
    Attached Files Attached Files

+ 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] VBA Sorting Issue
    By orlex in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-23-2015, 04:15 PM
  2. Sorting Issue
    By tom.mat.walker in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-31-2015, 08:51 AM
  3. Sorting Issue
    By 7hockey7 in forum Excel General
    Replies: 3
    Last Post: 01-30-2013, 08:54 AM
  4. Sorting issue
    By KTed in forum Excel General
    Replies: 1
    Last Post: 09-02-2012, 01:58 PM
  5. Sorting issue
    By Wayne Knazek in forum Excel General
    Replies: 5
    Last Post: 10-29-2008, 04:12 PM
  6. Sorting issue
    By wizgf19 in forum Excel General
    Replies: 9
    Last Post: 06-05-2008, 08:45 AM
  7. [SOLVED] Sorting issue
    By Sige in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-10-2006, 11:20 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