+ Reply to Thread
Results 1 to 3 of 3

How do you give text a value?

  1. #1
    Registered User
    Join Date
    09-25-2011
    Location
    Manchester, England
    MS-Off Ver
    Excel 2003
    Posts
    1

    Red face How do you give text a value?

    Hi there,

    This is my first post so please bear with me,

    I have produced an excel document to track pupil progress at school. The pupils are offered levels which go up in sub categories of a,b and c. so for example a pupil can start a subject at a level 4c and progress up to a 4a (the level after that being a 5c)

    I have a column which is highlighting whether a pupil is working on, above or below their predicted grade but excel seems to think that a 4c is a higher grade than a 4a and therefore is giving out the wrong information. Does anyone know how I can tell excel the order in which the grades work in Excel 2010?

    Thanks for any help.

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: How do you give text a value?

    Excel is evaluating the letters as described in the help for the different Option Compare Statement options. If you pull up the help, you will see:

    If used, the Option Compare statement must appear in a module before any procedures.

    The Option Compare statement specifies the string comparison method (Binary, Text, or Database) for a module. If a module doesn't include an Option Compare statement, the default text comparison method is Binary.

    Option Compare Binary results in string comparisons based on a sort order derived from the internal binary representations of the characters. In Microsoft Windows, sort order is determined by the code page. A typical binary sort order is shown in the following example:

    A < B < E < Z < a < b < e < z < À < Ê < Ø < à < ê < ø


    Option Compare Text results in string comparisons based on a case-insensitive text sort order determined by your system's locale. When the same characters are sorted using Option Compare Text, the following text sort order is produced:

    (A=a) < ( À=à) < (B=b) < (E=e) < (Ê=ê) < (Z=z) < (Ø=ø)
    My suggestion would be to come up with a new way to rank your pupils, Maybe 3.1 and 3.3 instead of 3a and 3c.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: How do you give text a value?

    With Excel, there are many ways to approach a problem, but knowing some of the specifics will help to narrow the search. Any chance you could post a sample workbook?
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

+ 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