+ Reply to Thread
Results 1 to 8 of 8

Problem with sorting in Excel 2003

  1. #1
    Registered User
    Join Date
    01-13-2008
    Posts
    5

    Problem with sorting in Excel 2003

    I'm more of a novice than a beginner. Up to this point, I have had a peripheral experience with Excel. I am building a spreadsheet for work using Excel and I am having trouble with sorting the data.

    The data I would like to sort the spreadsheet by is in column A. This data is numerical and is a composite score computed using info input elsewhere on the spreadsheet.

    The problem is, when I attempt to sort the rows according to the scores in column A by ascending or descending order, the scores are not sorted in the correct order. I am using the Sort command (Data - Sort). Excel recognizes that there is data next to my selection and gives me the option to expand to include that data or just sort what I have selected (Column A). Either way, the data does not sort correctly in numerical order. I have specified the format in column A as numbers.

    Brains a little fried working on this all day today. So, I apologize in advance if my typing is a little confusing. I tried to send up a couple of scans, but the files are too large and I can't shrink them without them being unreadable. Can anyone help?


    Thank-you,
    Richard

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    See if link helps

    http://video.about.com/spreadsheets/Sorting.htm

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    01-13-2008
    Posts
    5

    VBA Noob, thanks for the link....

    but it didn't fix my problem. The rows are still not sorting correctly. It's almost as if it is pulling data from the other columns to sort.

    The data I'm trying to sort has been computed from a function that uses data from elsewhere in that same row. Imagine it like this. I have a class of students who each have five grades. I write a function that averages the five grades for each student and places them at the end of the row in a separate column entitled "average". Now I want to sort the students in ascending or descending order based on their averaged scores.

    In my case, the data is being sorted (Excel shifts the rows around), except not in numerical order. Looks something like this...2, 3, 17, 12, 50, 24.

    I can't figure it out. Any suggestions?
    Richard

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Post a sample file with before and after results

    VBA Noob

  5. #5
    Registered User
    Join Date
    01-13-2008
    Posts
    5

    Before Sorting

    This is part of screenshot before sorting....
    Attached Images Attached Images

  6. #6
    Registered User
    Join Date
    01-13-2008
    Posts
    5

    after sorting....

    Screenshot after sorting (Clicking Sort under Data, and sorting by ascending using header row "Ranking.")
    Attached Images Attached Images

  7. #7
    Registered User
    Join Date
    01-13-2008
    Posts
    5

    Found a workaround....

    I worked out a work around for my problem. I used the "vlookup" command to write the data I wanted sorted to another sheet. Once I did that, the Sort command worked correctly. It is a bit inconvenient that I have to go to a separate sheet to rank my data, but it works!

    I'm obviously not an excel guru. When I watched the instructional vid recommended by VBA Noob, it struck me that he was sorting names, addresses, etc. I think the issue I encountered had to do with the fact that the data I was trying to sort was not pure data (i.e. name, address, etc.) but computed data (the data was the result of the mathematical function that occupied the field.) I think Excel included the inputs into the mathematical function when it tried to sort it, instead of just the product. By copying the computed data to a separate sheet, I was in essence converting it to pure data.

    I'd be interested in reading what the gurus think?

    Thanks for looking!
    Richard

  8. #8
    Registered User
    Join Date
    01-15-2008
    Posts
    16
    You can copy the column/cells and Paste Special --> Values into an adjacent column. This usually does the trick for me.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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