+ Reply to Thread
Results 1 to 9 of 9

If vlookup produces N/A results then takes value from another col.

  1. #1
    Forum Contributor
    Join Date
    03-08-2019
    Location
    England
    MS-Off Ver
    2016
    Posts
    104

    If vlookup produces N/A results then takes value from another col.

    Hello, Please could someone help with the following.

    SEE BELOW FOR CLEARER EXPLANATION
    Last edited by batexcel; 03-14-2019 at 07:26 AM. Reason: Example was not explained clear enough amendment below

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: If vlookup produces N/A results then takes value from another col.

    Description doesnt make sense.

    This

    =VLOOKUP(A1,Sheet2!A1:B1,2,0)

    is already taking the value from column B (of Sheet 2).

    Please explain clearly.

    Or do you mean column B of the same sheet that the formula is on? If so

    =IFERROR(VLOOKUP(A1,Sheet2!A1:B1,2,0),B1)
    Or something else?
    Last edited by Special-K; 03-14-2019 at 07:04 AM.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: If vlookup produces N/A results then takes value from another col.

    ??
    With this:
    =VLOOKUP(A1,Sheet2!A1:B1,2,0)
    you want B1 value ANYWAY
    So:
    =Sheet2!B1
    is enough.
    Quang PT

  4. #4
    Forum Contributor
    Join Date
    03-08-2019
    Location
    England
    MS-Off Ver
    2016
    Posts
    104

    Re: If vlookup produces N/A results then takes value from another col.

    Ah yes, I do apologise - I have tried attaching a file but I am unable too for some reason


    So,

    Col A1+2
    Example 1
    Example 2

    Col B1+2
    5
    5


    Col C1+2 (formula)

    =VLOOKUP(A1,D$1:E$1,2,0) THIS PRODUCES 1
    =VLOOKUP(A2,D$1:E$1,2,0) THIS PRODUCES #N/A



    Col D

    EXAMPLE 1

    Col E

    1

    In Col C when the vlookup produces #N/A value I want it to then take the value from Col B so Col C looks like


    1
    5


    My data is much much bigger - just using the above as an example
    Last edited by batexcel; 03-14-2019 at 07:08 AM.

  5. #5
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: If vlookup produces N/A results then takes value from another col.

    Quote Originally Posted by bebo021999 View Post
    ??
    With this:
    =VLOOKUP(A1,Sheet2!A1:B1,2,0)
    you want B1 value ANYWAY
    So:
    =Sheet2!B1
    is enough.
    But OP is saying that could return #NA which he doesnt want (he wants value "from col B" - but hasnt specified what sheet).

  6. #6
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: If vlookup produces N/A results then takes value from another col.

    @batexcel: Attaching files

    Use the Go Advanced option at the bottom of the page then scroll down to Manage Attachments as the "paperclip" method does not work on this forum.

  7. #7
    Forum Contributor
    Join Date
    03-08-2019
    Location
    England
    MS-Off Ver
    2016
    Posts
    104

    Re: If vlookup produces N/A results then takes value from another col.

    Thank you, will use that in future - hope my above example now adequately explains my issue. I am sorry again for my bad communication in the first example

  8. #8
    Forum Contributor
    Join Date
    03-08-2019
    Location
    England
    MS-Off Ver
    2016
    Posts
    104

    Re: If vlookup produces N/A results then takes value from another col.

    I think I have attached the example file this time
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: If vlookup produces N/A results then takes value from another col.

    You've got circular references in that file, formulas that refer to the cell they are in.

    Like this?

    in C2
    =IFERROR(VLOOKUP(A2,D$1:E$1,2,0),B2)

+ 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. Using ln() function produces strange results
    By OGAngryHulk in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-25-2018, 07:20 PM
  2. Conditional StDev Produces Erroneous Results
    By mjcarman01 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-15-2017, 09:20 PM
  3. [SOLVED] Offset - same formula produces different results
    By BRISBANEBOB in forum Excel General
    Replies: 4
    Last Post: 09-23-2016, 07:40 PM
  4. [SOLVED] Formula produces unexpected results
    By furface00 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-04-2014, 02:17 PM
  5. Same vba routine produces different results
    By john1674 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-10-2013, 05:44 AM
  6. VLOOKUP/formula produces #N/A
    By ge0rge in forum Excel General
    Replies: 7
    Last Post: 03-26-2009, 10:17 AM
  7. visual basic conditional formatting produces strange results
    By Carl in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-25-2006, 10:10 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