+ Reply to Thread
Results 1 to 5 of 5

2D lookup

  1. #1
    Registered User
    Join Date
    02-22-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    72

    2D lookup

    Capture.PNG

    I managed to create a code that looks for values and does some simple calculations before values are put in 2nd and 3rd row.

    How can I make the code do this for rest of the rows in Sheet1?

    What I'm trying to achieve is:

    Cell J2 =VLOOKUP($I3;Sheet2!$I:$AA;MATCH(Sheet1!J1;Sheet2!$I$1:$AA$1;0);0) -VLOOKUP($I2;Sheet2!$I:$AA;MATCH(Sheet1!J1;Sheet2!$I$1:$AA$1;0);0)

    I3 value fetched from Sheet2 minus I2 value fetched from Sheet2

    Cell J3 = (VLOOKUP($I3;Sheet2!$I:$AA;MATCH(Sheet1!J1;Sheet2!$I$1:$AA$1;0);0)-1) / VLOOKUP($I2;Sheet2!$I:$AA;MATCH(Sheet1!J1;Sheet2!$I$1:$AA$1;0);0)

    I3 value fetched from Sheet2 minus 1 divided by I2 value fetched from Sheet2

    Cell J4 = VLOOKUP($I5;Sheet2!$I:$AA;MATCH(Sheet1!J1;Sheet2!$I$1:$AA$1;0);0) -VLOOKUP($I4;Sheet2!$I:$AA;MATCH(Sheet1!J1;Sheet2!$I$1:$AA$1;0);0)

    Cell J5 = (VLOOKUP($I5;Sheet2!$I:$AA;MATCH(Sheet1!J1;Sheet2!$I$1:$AA$1;0);0)-1) / VLOOKUP($I4;Sheet2!$I:$AA;MATCH(Sheet1!J1;Sheet2!$I$1:$AA$1;0);0)

    The formula continues down to last row and to the right to last column. Lookup_value and column index are dynamic.



    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Cuni; 11-18-2022 at 10:19 AM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,570

    Re: Vlookup

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by protonLeah; 11-17-2022 at 08:54 PM.
    Ben Van Johnson

  3. #3
    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
    79,369

    Re: Vlookup

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    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.

  4. #4
    Registered User
    Join Date
    02-22-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    72

    Re: Vlookup

    Quote Originally Posted by protonLeah View Post
    Please Login or Register  to view this content.
    Tremendous thank you!

  5. #5
    Registered User
    Join Date
    02-22-2019
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    72

    Re: Vlookup

    Quote Originally Posted by AliGW View Post
    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ok yes, thanks!

+ 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. Replies: 1
    Last Post: 12-08-2020, 05:16 AM
  2. Replies: 5
    Last Post: 12-07-2016, 09:18 AM
  3. [SOLVED] When vlookup ragnes is mutiple: How do vlookup value finding occurrence against coresspond
    By silambarasan.J in forum Excel Formulas & Functions
    Replies: 34
    Last Post: 07-07-2015, 09:32 AM
  4. Replies: 0
    Last Post: 12-26-2013, 01:12 PM
  5. Display Cell within VLookup range that excel thinks matches the VLookup Value
    By headachexcelperson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-04-2013, 04:56 PM
  6. vlookup? match? index? MULTIPLE criteria for vlookup search problem....
    By aborg88 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-11-2013, 09:56 AM
  7. Replies: 5
    Last Post: 07-29-2009, 07:53 AM

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