+ Reply to Thread
Results 1 to 8 of 8

Convert numbers to sentences

  1. #1
    Registered User
    Join Date
    11-28-2009
    Location
    Norway
    MS-Off Ver
    Excel 2007
    Posts
    6

    Convert numbers to sentences

    Hello. I have cells with numbers representing a sentence. Every cell with the similar number are to be converted to the same sentence. Usually, this would be an easy "find and replace" job, but there are about 3000 different numbers / sentences. This would be fine, if it was a one time job, but this convertion has to be carried out several times in the future as more punching is finished. Is there a way to program Excel to automatically convert certain numbers to speceific sentences right away or in one automated process after punching has been made? Thanks.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Convert numbers to sentences

    How is your workbook organised.

    If like this;

    Please Login or Register  to view this content.
    You can use VLOOKUP function:

    VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])


    Making [range_lookup] FALSE your table doesn't need to be sorted and you can match only identical numbers (wich can't be more than once)

  3. #3
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Thumbs up Re: Convert numbers to sentences

    I have cells with numbers representing a sentence. Every cell with the similar number are to be converted to the same sentence.
    This statement seems to imply that you may have different sentences associated with a single number.

    Example:
    1 The quick brown fox
    1 It was a dark and stormy night

    If the above assumption is true, which is the correct sentence to associate with the number?

    I would start first by using Advanced Filter to extract a list of all the unique values into another list in order find and correct these errors. Once you have the list cleaned up create a master look up table and use the VLOOKUP function suggested by zbor.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  4. #4
    Registered User
    Join Date
    11-28-2009
    Location
    Norway
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Convert numbers to sentences

    Hello. I have as follows:

    A
    124038
    124039
    129027
    124038
    129028

    I want thos to be:
    A
    The fast fox
    The fast pig
    The slow whale
    The fast fox
    The slow mouse

    All numbers are 6 digits, they are all repeated several times in the CSV. sheet. There are about 3000 unique six digit combos, whic are to be replaced with about 3000 unique sentences. Over the next year, this process are to be repeated many times, so it would be nice not having to do the replacing job every time, but to let Excel know that number 124038 is supposed to be "The fast fox" every time without me converting it manually.

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Convert numbers to sentences

    Vlookup would be a good idea like the zbor had suggested.

    All sorts of threads on Vlookup in this forum, just search Vlookup.

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Convert numbers to sentences

    According to your example you can separate into two tables, to get better overview.

    124038
    124039
    129027
    124038
    129028

    If I'm getting it right, 124 stands for The fast and 129 stands for The slow.
    Then you can look other part of the word 038 for fox. Etc

    Maybe best way would be to upload example (avoid sensitive data)

  7. #7
    Registered User
    Join Date
    11-28-2009
    Location
    Norway
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Convert numbers to sentences

    Actually, the numbers can not be decyphered into anything. Every unique 6 digit number, has to be replaced by one sentence which will vary for every 6 digit number. This process is to be made several times over a long time, which is why I would like to have this process more or less automated after I have done it once. I asume I have to do it once to program it somehow. What is Vlookup? Thanks.

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Convert numbers to sentences

    I know that numbers are uniqe. I just assumed, over above example, that they can be gruped somehow.

    123 456
    123 654
    456 123

    are all uniqe, but first two are in same sub-group of 123 xxx

    But if they can't it doesnt matter.

    VLOOKUP is a excel function.

    I write you sintax above and for more informations see somewhere on the web.
    For example youtube:

    http://www.youtube.com/watch?v=GZX2iXfqALs

+ 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