+ Reply to Thread
Results 1 to 4 of 4

If C2=X then vlookup Range1 or if C2=Y then vlookup Range2

  1. #1
    Registered User
    Join Date
    07-05-2013
    Location
    North Carolina
    MS-Off Ver
    Excel 2010
    Posts
    9

    Question If C2=X then vlookup Range1 or if C2=Y then vlookup Range2

    If C2 = "Company" then lookup range of Company!A:B then match Data! column A to Company! column A and display the value from Company! column B.
    If C2 = "Owner" then lookup range of Owner!A:B then match Data! column A to Owner! column A and display the value from Owner! column B.


    Data:
    A B C D
    Employee # Name Type Vehicle #
    1 AB123 Andrew Baker Owner *FORMULA HERE*
    2 CD456 Chris Davidson Company *FORMULA HERE*
    3 EF789 Eric Ferguson Company *FORMULA HERE*
    4 GH123 Gary Harper Owner *FORMULA HERE*


    Company:
    A B
    Employee # Vehicle #
    1 CD456 1111
    2 EF789 2222

    Owner:
    A B
    Employee # Vehicle #
    1 AB123 0000
    2 GH123 3333

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: If C2=X then vlookup Range1 or if C2=Y then vlookup Range2

    How about:

    Please Login or Register  to view this content.
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  3. #3
    Registered User
    Join Date
    07-05-2013
    Location
    North Carolina
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: If C2=X then vlookup Range1 or if C2=Y then vlookup Range2

    @ConneXionLost Thank you that did it!

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

    Re: If C2=X then vlookup Range1 or if C2=Y then vlookup Range2

    How about..

    =VLOOKUP(A2,INDIRECT(C2&"!A:B"),2,0)
    Life's a spreadsheet, Excel!
    Say thanks, Click *

+ 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] Range1 = Range2 and Range2 = Range1
    By rawcode in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 12-10-2012, 04:28 AM
  2. [SOLVED] if range1=range2 then range A=RangeB
    By denvernuggets15 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2012, 12:55 AM
  3. If Range1 Not Hidden on Sheet1 Then Show Range2 on Sheet2
    By Johnathan in forum Excel General
    Replies: 1
    Last Post: 01-09-2012, 11:14 PM
  4. Transfer Item From Range1 to Range2 Using ListBox
    By hifliers in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-22-2009, 06:13 AM
  5. ???Sumif(Range1,Range1<Range2,Range1)???
    By Nick in forum Excel General
    Replies: 2
    Last Post: 04-14-2006, 02:30 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