+ Reply to Thread
Results 1 to 11 of 11

if,match,vlookup error

  1. #1
    Registered User
    Join Date
    11-02-2013
    Location
    Philadelphia,PA
    MS-Off Ver
    Excel 2010
    Posts
    9

    if,match,vlookup error

    Hey there,

    I am having trouble with this formula and am looking for some help with it. It works when vlookup finds the exact match, but when it doesn't, a N/A error code is displayed and I cannot seem to get rid of it. I am using this formula:

    [/CODE]=IF(MATCH(A7,$C$1:$C$7,0),VLOOKUP(A7,$C$1:$D$7,2,0),B7)[CODE]

    What I want it to do is if the value in column L is found in column B, then replace the value in column E with the value in column N. All of this is on the same row and the length of the columns change.

    Any ideas?? I have attached an example sheet. Book1-example.xlsx

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

    Re: if,match,vlookup error

    Try

    =IF(ISNUMBER(MATCH(A7,$C$1:$C$7,0)),VLOOKUP(A7,$C$1:$D$7,2,0),B7)

    Or even better

    =IFERROR(VLOOKUP(A7,$C$1:$D$7,2,0),B7)

  3. #3
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: if,match,vlookup error

    I think you could use

    =IFERROR (VLOOKUP(A7,$C$1:$D$7,2,0),B7)
    so if vlookup cannot find the item , it will error and so not lookup
    OR

    =IF(ISERROR(MATCH(A7,$C$1:$C$7,0)), B7,VLOOKUP(A7,$C$1:$D$7,2,0))
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Registered User
    Join Date
    11-02-2013
    Location
    Philadelphia,PA
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: if,match,vlookup error

    Sorry...I put the wrong formula in. That was the formula that worked when I was using only columns A,B,C and D but still gave me the N/A code or would return a zero. Is there anyway to run the same formula for the way I described on the example sheet??

  5. #5
    Registered User
    Join Date
    11-02-2013
    Location
    Philadelphia,PA
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: if,match,vlookup error

    Could it be that my columns aren't located directly next to each other now?? Because I need to match column B and L together and pull the value from column O??

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: if,match,vlookup error

    not sure where you are matching A7 with
    sorry , not sure what you are trying to achieve - can you explain the spreadsheet in more detail

  7. #7
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: if,match,vlookup error

    where do you want to put the value
    and what do you want if they do not match

    so in R put
    =INDEX(O:O,MATCH(B3,L:L,0))

  8. #8
    Registered User
    Join Date
    11-02-2013
    Location
    Philadelphia,PA
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: if,match,vlookup error

    I would like it to do this:

    =IF(MATCH(B3,$L$2:$L$7,0),VLOOKUP(L3,$N$2:$N$7,2,0),B3)

    So if the value found in column L is found in column B, then replace the value of the cell in column E with the value found in column N. I am putting this formula in column E where I want the result to be placed. If there is no match, I do not want the cell to change.

    Thank you for your patience. I really enjoy trying to figure these things out but I need sleep!! hahaha

  9. #9
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,737

    Re: if,match,vlookup error

    you will need VBA to do that
    you cant put a formula into a cell and keep the value thats already in the cell

  10. #10
    Registered User
    Join Date
    11-02-2013
    Location
    Philadelphia,PA
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: if,match,vlookup error

    Thank you very much for your help.

  11. #11
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: if,match,vlookup error

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. Replies: 13
    Last Post: 12-13-2012, 11:44 AM
  2. Vlookup or offset/match formula error
    By adam2308 in forum Excel General
    Replies: 2
    Last Post: 04-16-2009, 03:38 PM
  3. Replies: 3
    Last Post: 04-25-2007, 08:27 AM
  4. Run Time Error for Vlookup & Match command
    By Syed Haider Ali in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-19-2005, 02:05 PM
  5. Replies: 0
    Last Post: 08-25-2005, 03:46 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