+ Reply to Thread
Results 1 to 4 of 4

Lookup formula with 2 variable

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Lookup formula with 2 variable

    Hello:

    Please refer to attached file.

    I have data as shown in Sheet1
    Column B : VendorCode
    Column C : Size
    Range("F6:N6") is Store Name
    Each item has 2 lines of data, 1st line is Inventory and 2nd line is Qty Sold.
    Example:
    Range("F7:N7") is Inventory for Vendor Code in cell B7 for stores listed in Range("F6:N6")
    Range("F8:N8") is Inventory for Vendor Code in cell B7 for stores listed in Range("F6:N6")
    and so on

    I need formula in sheet2 in cells F10:H down to get data by using vendor code in column C and Store in COlumn D.


    Let me know if you have any questions.
    Thanks.

    Riz
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: Lookup formula with 2 variable

    Hello again, Riz.

    You can use the following array* formulae in the cells stated in Sheet2:

    F10: =INDEX(Sheet1!$C$7:$C$26,MATCH(1,(Sheet1!$A$7:$A$26=$B10)*(Sheet1!$B$7:$B$26=$C10),0))&""

    G10: =INDEX(Sheet1!$F$7:$N$26,MATCH(1,(Sheet1!$A$7:$A$26=$B10)*(Sheet1!$B$7:$B$26=$C10),0),MATCH($D10,Sheet1!$F$6:$N$6,0))

    H10: =INDEX(Sheet1!$F$7:$N$26,MATCH(1,(Sheet1!$A$7:$A$26=$B10)*(Sheet1!$B$7:$B$26=$C10),0)+1,MATCH($D10,Sheet1!$F$6:$N$6,0))

    *Note that array formulae need to be confirmed using the key combination of Ctrl-Shift-Enter (CSE), rather than the usual Enter.

    Then the formulae can be copied down to the bottom of your table, as can be seen in the attached file.

    Hope this helps.

    Pete

    EDIT: Sorry, I've just read your post again and realised I have them the wrong way round. The easy way around this is to just change the titles, but if you want to keep them in order then you will need to insert the +1 shown in red above into the formula in G10, and remove it in the formula in H10. Remember to use CSE each time to confirm the array formula, then copy down.

    Pete
    Attached Files Attached Files
    Last edited by Pete_UK; 06-10-2019 at 08:43 PM.

  3. #3
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Lookup formula with 2 variable

    Hello Pete:

    Great Work, Thanks a lot

    R

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,731

    Re: Lookup formula with 2 variable

    You're welcome, Riz - thanks for the rep.

    Pete

+ 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] Lookup Formula with 2 variable
    By rizmomin in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-20-2018, 04:15 PM
  2. [SOLVED] 2 Variable lookup
    By sarahqputra in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-09-2015, 02:29 AM
  3. [SOLVED] Lookup formula to find lowest value with variable lookup criteria
    By brharrii in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-27-2015, 03:00 AM
  4. Changing column variable on a copied formula instead of row variable
    By dsw283 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-06-2014, 04:13 PM
  5. Can I make the row lookup array/range part in an array formula variable?
    By OLLY-7 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-18-2014, 09:06 AM
  6. Insert variable in to formula (cell lookup)
    By jamie.finney in forum Excel General
    Replies: 1
    Last Post: 07-23-2010, 07:07 AM
  7. Variable row lookup
    By Vinnie881 in forum Excel General
    Replies: 1
    Last Post: 02-25-2008, 12:00 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