+ Reply to Thread
Results 1 to 10 of 10

Convert "text character" into unique values

  1. #1
    Registered User
    Join Date
    02-02-2010
    Location
    Brisbane
    MS-Off Ver
    Excel 2003
    Posts
    7

    Convert "text character" into unique values

    Hello all,

    I've done alot of searches already and still couldn't find a solution to my unique problem.

    I need to convert a particular cell of "text" into a value based on the sum of the individual characters on alpha order. Some cells would contain spaces, numbers and common symbols too.

    For example,

    "ABC" will convert to "6" (1+2+3)

    or

    "AB BA 3" will convert to "9" (1+2+2+1+3)

    or

    "AB/C" will convert to "6" (1+2+0+3) (anything other than text/number is 0)

    Is this even possible?

    My problem is that I need to identify each particular cell with an unique number, and these cells have unique texts including numbers/symbols.

    Please help.

    Thanks!

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Convert "text character" into unique values

    Is it a 1-26 scale for the Alphas or do you wish to adjust ?

    We need only consider addition ?

    Can the digits that appear occur multiple times and at any given point within a string ?

    Will the numeric values always be between 0-9 or would you have 12, -3 etc... ?


    The more examples your provide the better in truth... a sample file with all possible variants and expected results would be ideal.

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Convert "text character" into unique values

    If you're trying to create some sort of checksum, what is the intended use of the output? I ask because the values you give to each digit can lead to identical results from two separate text strings.

    If "A" = 1 and "B" = 2, then all of these text strings give the same result:

    AAAA
    BB
    AAB

    So, what happens in this situation?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    02-02-2010
    Location
    Brisbane
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Convert "text character" into unique values

    Hi,

    JBeaucaire, YES, I couldn't get into my head to use the word "checksum".

    That's what I want.

    I want to identify each cell uniquely with a checksum type function. I haven't been able to find one on the net yet that can do both text and numbers at the same time. (and including common symbols)

    For more details, I actually have a table with up to 25k+ rows and 4 columns of data. (i.e. 4 cells of data with text and number per row that identifies it)

    There is no unique identifier for each row at this time.

    There are exactly 717 rows of data that are exact duplicate of each other, and I want to filter the entire table so that only the duplicate rows remain (717 x 2).

    The checksum must work on all 4 columns of data as there are certain rows that have identical values in 3 of the 4 columns.

    I would then simply use the CountIF($A1:$A1000,A1)>1 formula to find if there were duplicates of the checksum value that identify the row.

    I hope this can be done.

    Many thanks!!!

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Convert "text character" into unique values

    Why not just concatenate the four columns and use that as the 'checksum?'
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Registered User
    Join Date
    02-02-2010
    Location
    Brisbane
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Convert "text character" into unique values

    YYYEEESSS! Got it working!

    Wow, such a simple solution. I never knew such a function exist!

    Thanks a ton again, love this place.

    Cheers,

    Temjin

  7. #7
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Convert "text character" into unique values

    Hi can you try this UDF

    Please Login or Register  to view this content.
    Then say in cell A1 pur ABBBA 3 and in B1 this formula
    Please Login or Register  to view this content.
    Answer would be 11
    Last edited by contaminated; 02-03-2010 at 02:36 AM.
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Convert "text character" into unique values

    Contaminated, try running your UDF against these two strings:

    dogs I hate.
    I hate dogs.

    They result in the same thing, thus it's not a usable checksum. A true checksum only results in the exact same output when the cells are exactly the same.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Convert "text character" into unique values

    A true checksum only results in the exact same output when the cells are exactly the same.
    If that were true, JB, checksums would need to be the same length as the data. Parity is a single-bit checksum, right?

    I agree that a useful checksum shouldn't succumb to something as simple as the example.

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Convert "text character" into unique values

    Quote Originally Posted by shg View Post
    If that were true, JB, checksums would need to be the same length as the data. Parity is a single-bit checksum, right?
    Duh, my bad, yes, that could be true. I've had limited experience with checksums, and all the ones I've had to verify were much longer values...6-8 digit answers. But of course, some could result in single digit results.

+ 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