+ Reply to Thread
Results 1 to 8 of 8

Converting a column of text data by assigning numbers to each type of response

  1. #1
    Registered User
    Join Date
    02-27-2013
    Location
    oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    3

    Converting a column of text data by assigning numbers to each type of response

    I have a long column of data where each cell in that column has 1 of 4 responses. I would like each of those responses to correspond to a number (0,1,2 or 3) and be converted either in an adjacent column of in the column itself so that every response has an assigned number.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Converting a column of text data by assigning numbers to each type of response

    =if(A1="X",0,if(A1="Y",1,If(A1="Z",2,3)))

    this should work. change the values to what is in your spreadsheet and copy down in the adjacent cell.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Converting a column of text data by assigning numbers to each type of response

    or use Vlookup for that.

    Make a table with the letters and the corresponding value.

    Then you can use Vlookup to get the data.

    the syntax off the formula will be:

    Vlookup(a1,V1:W4,2,0)
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Registered User
    Join Date
    02-27-2013
    Location
    oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Converting a column of text data by assigning numbers to each type of response

    Is there any reason why this wouldn't work?

    =IF(AD3="1 to 3",0,IF(AD3="None",1,IF(AD3="More than 12",2,3)))

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Converting a column of text data by assigning numbers to each type of response

    Yes.

    The syntax of the formula isn't right.

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Converting a column of text data by assigning numbers to each type of response

    On this site, look at the "If" functions, the "Or" function and the "And" function to understand the syntax.

    http://www.techonthenet.com/excel/fo...x_ws_alpha.php

  7. #7
    Registered User
    Join Date
    02-27-2013
    Location
    oklahoma
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Converting a column of text data by assigning numbers to each type of response

    oeldere, can you explain why the syntax is wrong?

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Converting a column of text data by assigning numbers to each type of response

    Do your cells actually contain "1 to 3" or do they contain 1, 2 or 3. This is important to know in setting up the IF statement. From your original posting it appeared that the cells contained only 1 or four numbers. Please clarify or post a copy or your worksheet so that we can see what is really in your sheet.

+ 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