+ Reply to Thread
Results 1 to 11 of 11

Sorting from ascending orders.

  1. #1
    Registered User
    Join Date
    08-29-2017
    Location
    singapore
    MS-Off Ver
    2017
    Posts
    6

    Sorting from ascending orders.

    I had a set of number from 0 - 9, a total number that appear the most.

    fKCekVG.png

    What i was expecting that the column of number appear will sort by ascending order without affecting the formula.

    What i did was i go to the data -> sort smallest to largest

    What i expected

    ThapWny.png

    What i get after sorting from ascending orders

    225gC7Y.png

    Appreciate if you guys can help me sort this out.

  2. #2
    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: Sorting from ascending orders.

    ideliveryx welcome to the forum.

    Try selecting/highlighting both columns of numbers (excluding the headers). Tab until the right hand column is the active column. Then click Data>Sort A-Z (smallest to largest). The other column will rearrange and maintain their relationships with the second column.

    If that doesn't work we will need to see what the formula(s) are.
    Dave

  3. #3
    Registered User
    Join Date
    08-29-2017
    Location
    singapore
    MS-Off Ver
    2017
    Posts
    6

    Re: Sorting from ascending orders.

    I did exactly what you said. But there's an error on it. The last picture above shows is a hard coded cells on it.

    oYfQBw9.png

    The formula i'm using are countif formula.

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Sorting from ascending orders.

    I think the formula has the same sheet reference, you have to remove the sheet name in formula
    suppose you have two sheets - sheet1 & sheet2 and you are looking sort data in sheet2 in B2
    you have the following formula =SUMIFS(Sheet1!$B$2:$B$11,Sheet1!$A$2:$A$11,Sheet2!$A2)
    in this case you will not the sort will not work properly change the formula as
    =SUMIFS(Sheet1!$B$2:$B$11,Sheet1!$A$2:$A$11,$A2) do it for all
    if it will not works pls attach a sample excel file
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  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: Sorting from ascending orders.

    @ ideliveryx
    I think we are going to need a small Excel workbook that behaves the way you describe ... (not pics or screenshots ... saves retyping data and we can see this behavior in the context of the formulas)

    To attach a file to your post,
    • be sure to desensitize the data
    • click “Go Advanced” (next to Post Quick Reply – bottom right),
    • scroll down until you see “Manage Attachments”, click that,
    • click “Browse”.
    • select your file(s)
    • click “Upload”
    • click “Close window”
    • click “Submit Reply”

    The file name will appear at the bottom of your reply.

  6. #6
    Registered User
    Join Date
    08-29-2017
    Location
    singapore
    MS-Off Ver
    2017
    Posts
    6

    Re: Sorting from ascending orders.

    I have attach an file below.
    Attached Files Attached Files

  7. #7
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,910

    Re: Sorting from ascending orders.

    Change: =COUNTIF(A1:G9,"0")

    To: =COUNTIF($A$1:$G$9,"0")

    Or: =COUNTIF($A$1:$G$9,K5)

  8. #8
    Registered User
    Join Date
    08-29-2017
    Location
    singapore
    MS-Off Ver
    2017
    Posts
    6

    Re: Sorting from ascending orders.

    Thanks Phuocam, the issue has solved. just another question, Is there a way to make it in such a way that it will automatically sort itself from ascending orders?

  9. #9
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Sorting from ascending orders.

    is the numbers always between 0 to 9

  10. #10
    Registered User
    Join Date
    08-29-2017
    Location
    singapore
    MS-Off Ver
    2017
    Posts
    6

    Re: Sorting from ascending orders.

    yes mr nflsales

  11. #11
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Sorting from ascending orders.

    Then
    L5=SMALL(INDEX(COUNTIF($A$1:$G$9,ROW(INDIRECT("1:10"))-1),0),ROWS(L$5:L5))
    K5=SMALL(INDEX((COUNTIF($A$1:$G$9,ROW(INDIRECT("1:10"))-1)<>$L5)*11+ROW(INDIRECT("1:10"))-1,0),COUNTIF(L$5:L5,L5))
    Try this and copy towards down
    see the attached file
    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. Automatically sorting orders to separate sheets?
    By savvy913 in forum Excel General
    Replies: 2
    Last Post: 04-07-2016, 05:05 PM
  2. [SOLVED] Ascending sorting within cell
    By Villalobos in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-03-2014, 11:02 AM
  3. Sorting orders with a monthly cap
    By keeblerelf in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-17-2014, 04:26 PM
  4. Sorting first 'Material' ending with "S' only and rest in ascending orders with totals
    By PRADEEPB270 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-10-2014, 03:22 AM
  5. Help with sorting customer orders and outputting them to a new sheet
    By JBrez in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 06-17-2012, 07:21 PM
  6. x axis ascending order without sorting
    By vbidiot in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-30-2008, 09:31 AM
  7. ascending sorting
    By fofomama in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-14-2006, 10:45 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