+ Reply to Thread
Results 1 to 12 of 12

Excel 2007 : replace words with numbers

  1. #1
    Registered User
    Join Date
    03-02-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    10

    replace words with numbers

    How do I replace RED with 1, BLUE with 2, and GREEN with 3 automatically?

    http://img96.imageshack.us/img96/993...4234234led.jpg

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: replace words with numbers

    Using the Edit|Replace Feature..
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    03-02-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: replace words with numbers

    thanks, i found it.
    Last edited by gomes.; 03-02-2010 at 09:38 AM.

  4. #4
    Registered User
    Join Date
    03-02-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: replace words with numbers

    erm, there is a problem.

    Although the cell says BLUE/RED/GREEN, actually its a formula that caused the BLUE/RED/GREEN to appear, i didnt manually type out BLUE/RED/GREEN.

    So how would i do it? cheers!

    edit: I tried using the look in: Values. but the trouble is that it only works for Find. When i go to the replace tab, look in: only gives the option of formulas, but no values.
    Last edited by gomes.; 03-02-2010 at 09:48 AM.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: replace words with numbers

    It should still work... it will replace the text in the formula, so that the result will correspondingly change....

  6. #6
    Registered User
    Join Date
    03-02-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: replace words with numbers

    Sorry, i might have misphrased my question.

    I used the round function to round the numbers, and for the rounded numbers i want to change it lets say 4 to red, and 3 to green. How would i do that?

    http://img16.imageshack.us/img16/129...53rgergerg.jpg

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: replace words with numbers

    You will need to add a tempory column...

    use formula in D2: =Choose(C2,"RED","GREEN","BLUE","PINK",etc...) listing the colour scheme in order sequence, so that if C2 equals 1 it chooses Red, if it is 2, it chooses Green, and so on.

    Then copy that new range, go to C2 and do Edit|Paste Special Values.. over the Round() formulas... then you can delete the helper column...

    Note:

    You can also build this into the formula in C2 and not have to overwrite formulas or use helper columns...

    e.g.

    =CHOOSE(ROUND(B2,0),"RED","GREEN","BLUE","PINK",etc...)

  8. #8
    Registered User
    Join Date
    03-02-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: replace words with numbers

    thanks, I just have one questoin

    Then copy that new range, go to C2 and do Edit|Paste Special Values.. over the Round() formulas... then you can delete the helper column...
    What do you mean by new range? Could you explain to me this bit, cause im not sure what to do.

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: replace words with numbers

    The new range is the range from D2 down where you entered the helper formula....

    copy that, then go to C2, go to Edit|Paste Special and select Values.

    After you click Ok and the colours have been copied over, you can delete that helper column range....

  10. #10
    Registered User
    Join Date
    03-02-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: replace words with numbers

    Thanks, i got it to work now Appreciate it.

    just wondering, is there an easier way/another way to do it using the Edit|Replace feature, instead of the count feature?

    cheers

    edit: like is it possible to just use Edit|Replace whilst the formula's are in the cell (the problem i had above)

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: replace words with numbers

    No, only if the text you are trying to replace is in the formula itself or in the cell itself...

    Did you try my second formula suggestion.. that allows you to keep the ROUND() function and then convert to text colour in same formula.. so that you don't have to convert to Values.. this is useful, if you intend to change around the column B entries and expect the colour to coincide with updates...

  12. #12
    Registered User
    Join Date
    03-02-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: replace words with numbers

    ah okay, thats fine.

    thanks, i did try the 2nd formula u gave me, it worked. but i was just asking more about the first, cause i'd prefer to "know" both methods.

    Thanks again, appreciate it!

+ 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