+ Reply to Thread
Results 1 to 5 of 5

Nested IF and VLOOKUP formula?

  1. #1
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    157

    Nested IF and VLOOKUP formula?

    Hi everyone,

    I've been stumped on this for a while and keep coming back to it to try and figure something out but so far I've had no luck.

    I'm trying to generate approximate delivery dates based on the sender and receiver locations.

    So far I have managed to create a bit of a messy IF formula which seems to almost be working backwards.

    I have tried to write a formula that says if column E equals "GTC" then look in the "TOGTC" table on Sheet3 to return the number next to the match from column D(Sheet1) and add the date that is in column F to it.

    The next part of the formula is supposed to be another condition but I've onbviously done something wrong as it is taking this for the IF FALSE condition.

    Basically what I'm trying to say is, is it possible to have multiple IF TRUE conditions that all require VLOOKUP formulas?


    Thanks for your help,

    Alex
    Attached Files Attached Files

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Nested IF and VLOOKUP formula?

    Try

    =IFERROR(VLOOKUP(D2,INDIRECT("to"&E2),2,FALSE)+F2,"")

    Copy down
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: Nested IF and VLOOKUP formula?

    Quote Originally Posted by Ace_XL View Post
    Try

    =IFERROR(VLOOKUP(D2,INDIRECT("to"&E2),2,FALSE)+F2,"")

    Copy down
    Thank you so much! this works perfectly...will it work for all of my 10 tables in Sheet3?

    Also, could you please talk me through this formula if possible? For future reference.

    Thanks again

  4. #4
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Nested IF and VLOOKUP formula?

    hi alexander. it will work for all your 10 tables since all of your named range are typed as TOLocation. what Ace_XL was to combine the word "to" to the E2 (where it was dispatched to) and put them in a formula called INDIRECT.
    "to"&E2 gives you "toGTC". but you can't do a VLOOKUP inside this text and return a value. you need to let Excel know that "toGTC" is a Named Range. hence, INDIRECT was used in this instance. so it will work if Column E has your Dispatched destination and your Named Range is TOLocation.

    IFERROR is then to ensure that if the VLOOKUP formula encounters an error (not found in this case), it returns a blanks

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  5. #5
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: Nested IF and VLOOKUP formula?

    Quote Originally Posted by benishiryo View Post
    hi alexander. it will work for all your 10 tables since all of your named range are typed as TOLocation. what Ace_XL was to combine the word "to" to the E2 (where it was dispatched to) and put them in a formula called INDIRECT.
    "to"&E2 gives you "toGTC". but you can't do a VLOOKUP inside this text and return a value. you need to let Excel know that "toGTC" is a Named Range. hence, INDIRECT was used in this instance. so it will work if Column E has your Dispatched destination and your Named Range is TOLocation.

    IFERROR is then to ensure that if the VLOOKUP formula encounters an error (not found in this case), it returns a blanks
    Thank you very much that makes sense to me now...I'm learning slowly but surely! Thanks again

+ 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] Nested VLookup Formula
    By chris.slater in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-20-2013, 06:53 AM
  2. [SOLVED] Nested IF/OR with VLOOKUP formula
    By jakeisbill in forum Excel General
    Replies: 7
    Last Post: 05-07-2012, 02:28 PM
  3. VLOOKUP and IF nested formula?
    By camdameron in forum Excel General
    Replies: 6
    Last Post: 04-28-2011, 09:17 AM
  4. Replies: 2
    Last Post: 10-08-2009, 09:51 PM
  5. Need a nested IF formula or Vlookup
    By Natalie_M in forum Excel General
    Replies: 8
    Last Post: 02-21-2009, 08:47 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