+ Reply to Thread
Results 1 to 6 of 6

Thread: if else with character

  1. #1
    Registered User
    Join Date
    01-11-2012
    Location
    india
    MS-Off Ver
    ms office2007
    Posts
    4

    if else with character

    how to replace character by the numeric no.

    i have a list of color ,i want to when someone chose the color name ..it show its designated Numerical No...
    like this.

    color name color code
    Red 1
    Blue 2
    Black 3
    white 4
    new green 5
    pink 6
    orange 7
    dark green

    thanks in advance

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

    Re: if else with character

    You can use VLOOKUP

    e.g.

    If list is in X1:Y10 and user enters colour in A2, then formula would be:

    =VLOOKUP(A2,$X$1:$Y$10,2,FALSE)

    See VLOOKUP help in Excel help files for more.
    Last edited by NBVC; 01-13-2012 at 10:21 AM.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Valued Forum Contributor
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    1,957

    Re: if else with character

    If your colours are in column A and the numerical values in column B, with the selected colour in, say, cell C1 then in another cell try:

    =VLOOKUP(C1,A:B,2,FALSE)

  4. #4
    Valued Forum Contributor
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    1,957

    Re: if else with character

    Quote Originally Posted by NBVC View Post
    If list is in X1:Y10 and user enters colour in A2, then formula would be:

    =VLOOKUP(A1,$X$1:$Y$10,2,FALSE)
    Might need a tweak there, NBVC

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

    Re: if else with character

    Thanks Andrew... fixed.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  6. #6
    Registered User
    Join Date
    01-11-2012
    Location
    india
    MS-Off Ver
    ms office2007
    Posts
    4

    Re: if else with character

    thanks lot..it done..

+ 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.2.0