+ Reply to Thread
Results 1 to 6 of 6

edit my VLOOKUP formula

  1. #1
    Forum Contributor
    Join Date
    03-20-2013
    Location
    London, England
    MS-Off Ver
    Excel 2011
    Posts
    474

    edit my VLOOKUP formula

    im using the following formula to change the words Forward, Left, Right, and Back into the word "Pass" in a new column.

    =VLOOKUP(A1, {"Forward","Pass";"Left","Pass";"Right","Pass";"Back","Pass"},2,0)

    However, the other words listed in column A, are converted into N/A errors.
    is it possible for my formula to do what i want above but also leave the other words in column A unchanged in the formula column

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: edit my VLOOKUP formula

    Try

    =IF(OR(A1={"Forward","Left","Right","Back"}),"Pass",A1)

  3. #3
    Forum Contributor
    Join Date
    03-20-2013
    Location
    London, England
    MS-Off Ver
    Excel 2011
    Posts
    474

    Re: edit my VLOOKUP formula

    silly me, i forgot to mention that i also would like to make the words "fast" and "slow" be changed to "speed"

    so all in all:
    forward, left, right, and back converted to "pass"
    fast and slow converted to "speed"
    AND other remaining words stay unchanged.

    thanks

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: edit my VLOOKUP formula

    ok..

    =IF(OR(A1={"Forward","Left","Right","Back"}),"Pass",IF(OR(A1={"Fast","Slow"}),"Speed",A1))

    It would probably be easiest to build a lookup table on your sheet somehwere, say G2:H7
    G2:G7 = left right forward back fast slow
    H2:H7 = pass pass pass pass speed speed

    Then use
    =IFERROR(VLOOKUP(A1,G2:H7,2,FALSE),A1)

  5. #5
    Forum Contributor
    Join Date
    03-20-2013
    Location
    London, England
    MS-Off Ver
    Excel 2011
    Posts
    474

    Re: edit my VLOOKUP formula

    used the =IF(OR(A1={"Forward","Left","Right","Back"}),"Pass",IF(OR(A1={"Fast","Slow"}),"Speed",A1))
    works perfectly

    thanks!!

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: edit my VLOOKUP formula

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VLOOKUP Not Calculating - Unless I Edit Text Field
    By reactant in forum Excel General
    Replies: 1
    Last Post: 09-24-2012, 11:00 PM
  2. Excel Form With Vlookup and Edit and add feature
    By jadown in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-22-2010, 02:33 PM
  3. Edit VBA vlookup code
    By fire_water in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-04-2009, 08:10 AM
  4. Edit VLOOKUP Result
    By thomas.szwed in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-28-2008, 10:58 AM
  5. Vlookup doesn't work until i edit(but not change) the lookup cell
    By Confused in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-08-2005, 05:25 AM

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