+ Reply to Thread
Results 1 to 5 of 5

IF VLOOKUP Formula

  1. #1
    Registered User
    Join Date
    12-15-2020
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2

    IF VLOOKUP Formula

    Hi,

    I'm trying to do an IF VLOOKUP formula in column D. If there is a 1 in column A, I want the vlookup to pull from the FRUITS table (J3:K21). If there is a 1 in column B, I want the vlookup to pull from the VEGETABLES table (J26:K44). This formula returns the correct ACCT when there is a 1 in column A, but not when there is a 1 in column B (cell D4 & D8). I tried putting an IFERROR vlookup in the first part of the formula, but got no results, so I removed it. Also have 2 supplemental objectives on the attachment (labeled 2 & 3 on rows 14 & 15), but not as high-priority as the request listed here.

    Thank you, any help is much appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: IF VLOOKUP Formula

    Hi
    Try this in D2:
    =IFERROR(IF(A2=1,VLOOKUP(C2,$J$3:$K$21,2,0),IF(B2=1,VLOOKUP(C2,$J$26:$K$44,2,0),"")),IF(A2=1,179,IF(B2=1,279)))
    Last edited by Limor_OP; 12-15-2020 at 05:50 PM.

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: IF VLOOKUP Formula

    or try below formula

    =IFERROR(VLOOKUP(C2,IF(A2=1,$J$3:$K$21,IF(B2=1,$J$26:$K$44)),2,0),"")
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Registered User
    Join Date
    12-15-2020
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2

    Re: IF VLOOKUP Formula

    Works perfectly, thank you so much.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,912

    Re: IF VLOOKUP Formula

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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. [SOLVED] VLOOKUP formula or VLOOKUP worksheet.function
    By Crispy85 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-09-2017, 09:40 AM
  2. Replies: 5
    Last Post: 12-07-2016, 09:18 AM
  3. VBA external VLOOKUP instead of VLOOKUP-formula in cell
    By ExcelBonk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-07-2016, 02:41 PM
  4. [SOLVED] Vlookup with column name instead of col_index_name(3rd Section of Vlookup formula)
    By akulka58 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-21-2014, 10:42 AM
  5. [SOLVED] VBA code for change vlookup formula to vlookup formula with ISNA
    By erprasannaa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-12-2013, 03:33 AM
  6. Vlookup referencing a vlookup formula
    By laurenann in forum Excel General
    Replies: 1
    Last Post: 01-24-2011, 05:52 PM
  7. vlookup-reate a vlookup formula?
    By Pam C in forum Excel General
    Replies: 1
    Last Post: 03-16-2006, 12:15 PM

Tags for this Thread

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