+ Reply to Thread
Results 1 to 6 of 6

Values lookup in two different tables

  1. #1
    Registered User
    Join Date
    05-27-2016
    Location
    Los Angeles, USA
    MS-Off Ver
    2013
    Posts
    2

    Values lookup in two different tables

    Gurus,
    Need your help. Hope someone can show me how solve this.

    Sheet1
    Capture1.jpg


    Sheet2
    Capture2.jpg



    This is similar to VLOOKUP

    LOGIC:
    -----------------------------
    Check if L1 value matches any cell value in Column A
    If it find hits, for that hit row, check
    if Column E >= M, take value from F, multiply with M1 and then put in O1 (=cell corresponding to L1 row)
    else, check if Column C<=N, then put value from B into O1
    else, take value from D and put into O1

    else fill with 'no value found'

    Similarly next I have to pick L2 and check for a hit in Column A put that final value in O2 (= cell corresponding to L2 row), etc
    ------------------------------
    There are 1000 of rows in First table. So I have to run this formula or macro for all the row and fill Column O.

    I have data for each table in separate worksheet: Sheet 1 and Sheet 2.
    If someone can give a (vlookup) formula or macro, that would be very very helpful. I can run for column O.

    Thanks a lot!

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Values lookup in two different tables

    Welcome to the forum. Please attach a sample of the workbook from which the two images were made. Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Registered User
    Join Date
    05-27-2016
    Location
    Los Angeles, USA
    MS-Off Ver
    2013
    Posts
    2

    Re: Values lookup in two different tables

    Here is the file.

    Column O should be filled based on my logic.
    I put the expected value in Column R for your verification.

    thanks a lot
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Values lookup in two different tables

    I don't understand why the expected value in R2 is 10. To me it appears that according to the logic from post #1 "if Column E >= M, take value from F, multiply with M1 and then put in O1 (=cell corresponding to L1 row)" which becomes be IF 150>21 THEN 0*21 the value in R2 (O2) should be 0.

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Values lookup in two different tables

    Here is a formula, based on the logic from post #1, that can be pasted in O2 and double clicked (fill handle) so as to copy down as far as needed:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Notice that most of the values yielded by the formula do not match values given in column R.

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Values lookup in two different tables

    There is something wrong somewhere. JeteMc's formula follows the logic of the first message perfectly as far as I can tell. That being the case, the values in column R cannot be correct. Please confirm both the logic, using the actual cell references in the workbook and the expected values that are in column R.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

+ 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] 2 way lookup between tables
    By joedrummer in forum Excel General
    Replies: 4
    Last Post: 01-28-2012, 12:49 PM
  2. Lookup in several tables
    By afriedman in forum Excel General
    Replies: 6
    Last Post: 02-16-2011, 04:44 AM
  3. Excel 2007 : Lookup different tables
    By toclare84 in forum Excel General
    Replies: 6
    Last Post: 08-18-2010, 04:16 AM
  4. Lookup in sub-tables
    By djws in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-12-2008, 05:39 PM
  5. [SOLVED] lookup two tables
    By Titus in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-20-2006, 03:30 AM
  6. [SOLVED] lookup tables
    By Pat in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-07-2005, 08:25 PM
  7. Lookup tables
    By Dave in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-07-2005, 09:07 PM
  8. [SOLVED] lookup tables
    By Richard D in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-09-2005, 03:06 PM

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