+ Reply to Thread
Results 1 to 3 of 3

IF statement for lookup in table

  1. #1
    Registered User
    Join Date
    02-02-2016
    Location
    Haverhill, MA
    MS-Off Ver
    2013
    Posts
    7

    IF statement for lookup in table

    Hi,

    I am creating a travel spreadsheet for work.

    I have data validation in place for the origin so that it must be one of the 628 airport codes we use internally.

    What I am trying to do is set the destination so that it can only be one of the destinations available from that origin.

    For example, if an individual plans to leave Albuquerque, NM (ABQ) and go to Providence, RI (PVD), that trip is not available with our internal system. Instead, the traveler would have to go to Boston, MA (BOS).

    I currently have a separate tab with all our 12,000 possible combinations sorted by origin, as below. Would I have to sort by origin, then by destination alphabetically? Would it be a formula or data validation I need to use to achieve this? I also need to do the same thing but with the full city names spelled out, but I assume the same formula would work for both.

    ABQ ICN
    ABQ LHR
    ABQ AUH
    ABQ MUC
    ABQ CBR
    ABQ MXP
    ABQ ASP
    ABQ TUS
    ABQ PHX
    ABQ LAX
    ABQ BOS
    ABQ DCA

    Thanks for your help!

  2. #2
    Registered User
    Join Date
    01-08-2014
    Location
    Missouri
    MS-Off Ver
    365
    Posts
    87

    Re: IF statement for lookup in table

    This can be tough to describe, I've attached a spreadsheet to illustrate.

    You need to set-up a Named Reference (Dest_List, for example) using an Offset formula something like this:

    =OFFSET($A$1,MATCH($D$2,$A$2:$A$24,0),1,COUNTIF($A$2:$A$24,$D$2))

    Then, in your Data Validation, you refer to that Named Reference

    =Dest_List

    See attached. If you have specific questions, we can work through them one at a time...
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,736

    Re: IF statement for lookup in table

    Re eibi reply: set Departure as a Named list to be used in Data Validation.

+ 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. How to lookup a value in a table using a range in the lookup columns
    By premis in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-03-2016, 02:47 PM
  2. Replies: 1
    Last Post: 06-25-2014, 10:07 AM
  3. Lookup a blank cell in a Lookup table and return a figure.
    By jonnops in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-20-2014, 07:33 AM
  4. [SOLVED] Lookup question matching part of lookup value in the table array
    By kosmo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-05-2013, 11:07 AM
  5. Replies: 3
    Last Post: 01-27-2011, 10:02 AM
  6. Lookup table and If statement
    By shatzia in forum Excel General
    Replies: 3
    Last Post: 10-12-2010, 07:20 PM
  7. Replies: 0
    Last Post: 08-02-2005, 01:05 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