+ Reply to Thread
Results 1 to 10 of 10

Pulling rate from a table using two variables using SUMPRODUCT, INDEX, MATCH

  1. #1
    Registered User
    Join Date
    08-14-2016
    Location
    Wisconsin
    MS-Off Ver
    2010
    Posts
    5

    Pulling rate from a table using two variables using SUMPRODUCT, INDEX, MATCH

    I need to pull the rate using a table with multiple effective dates (column b in the Rate attachments) and multiple names. On the attached images I am able to pull the data if there is only one name in the source data, but my formula does not work when I have multiple names.

    Formula:
    =SUMPRODUCT((Rate2!C:C*1)*(Rate2!A:A=INDEX(Rate2!A:A,MATCH(A2,Rate2!A:A,0)))*(Rate2!B:B=INDEX(Rate2!B:B,MATCH(D2,Rate2!B:B,1))))

    1 Name.PNG
    Rate2.PNG
    2 Names.PNG
    Rate.PNG

    This is the first time I've tried using these functions and any guidance would be very much appreciated!

    Thank you.
    Attached Files Attached Files
    Last edited by uffda1; 08-15-2016 at 06:34 AM. Reason: Attaching file

  2. #2
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: Pulling rate from a table using two variables using SUMPRODUCT, INDEX, MATCH

    You are matching the value of column D with the value of Column B. But B is Rate and D is Date. That's why your formula isn't working.

    This may be
    Please Login or Register  to view this content.

    But I am not sure without seeing your file.
    Last edited by sanram; 08-14-2016 at 08:43 PM.

  3. #3
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Pulling rate from a table using two variables using SUMPRODUCT, INDEX, MATCH

    Security software blocks most images embedded in the forum, you can see them if you post them because the original is still in your browser cache. Everyone else will see one of those little 'Image cannot be displayed' icons!

    Please attach a sample file containing relevant fictional data to illustrate your problem.

    As you have a partially working formula, enter that into the sheet as well to show the results it returns.

    In the next column, type in the results that you actually want so that we can clearly see the differences.

    Important bit! Please check your 'Expected results' column carefully. (many people don't check, it is unbelievable how often we see a sample where the expected result of 1+1 is 3)

  4. #4
    Registered User
    Join Date
    08-14-2016
    Location
    Wisconsin
    MS-Off Ver
    2010
    Posts
    5

    Re: Pulling rate from a table using two variables using SUMPRODUCT, INDEX, MATCH

    Thanks for the tips! I attached the file to the original post. The formula is in column B.

  5. #5
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Pulling rate from a table using two variables using SUMPRODUCT, INDEX, MATCH

    Based on your sample file, try this formula

    =LOOKUP(2,1/(($F$2:$F$17=A2)*($G$2:$G$17<=D2)),$H$2:$H$17)

    Sumproduct can be a powerful tool, it could possibly be used for what you need, but the lookup method is much simpler.

  6. #6
    Registered User
    Join Date
    08-14-2016
    Location
    Wisconsin
    MS-Off Ver
    2010
    Posts
    5

    Re: Pulling rate from a table using two variables using SUMPRODUCT, INDEX, MATCH

    It looks like this works!!! Thank you so much! I'll apply to my larger dataset today and do some testing, but it looks good so far. I don't understand the "2,1/" logic so have some learning to do.

    Thank you!

  7. #7
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Pulling rate from a table using two variables using SUMPRODUCT, INDEX, MATCH

    The array elements return TRUE or FALSE for each row in the table

    (($F$2:$F$17=A2)*($G$2:$G$17<=D2))

    TRUE * TRUE = 1, anything else = 0, so you only get 1 in the rows that meet both criteria.

    Then comes the division part, 1/(array) 1/1 is still 1, 1/0 will result in a #DIV/0 error for the rows that don't meet the criteria.

    LOOKUP uses an approximate match, so it finds the last entry less than or equal to the criteria of 2, i.e. the last row that the array returns 1, which is the most recent date that meets both criteria.

    Hope that makes sense.

  8. #8
    Registered User
    Join Date
    08-14-2016
    Location
    Wisconsin
    MS-Off Ver
    2010
    Posts
    5

    Re: Pulling rate from a table using two variables using SUMPRODUCT, INDEX, MATCH

    Thank you for explaining. It all makes sense to me now except the 2. Does the 2 mean the formula is comparing the last 2 results?

  9. #9
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Pulling rate from a table using two variables using SUMPRODUCT, INDEX, MATCH

    No, it's just looking for the last occurrence of 1 in the array, 2 is greater than 1, so it will always find the last result, regardless of how many there are.

  10. #10
    Registered User
    Join Date
    08-14-2016
    Location
    Wisconsin
    MS-Off Ver
    2010
    Posts
    5

    Re: Pulling rate from a table using two variables using SUMPRODUCT, INDEX, MATCH

    Ok, thank you so much! I appreciate your time!

+ 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. Possible INDEX/MATCH FORMULA to get FX Rate in Currency table
    By almugs in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-07-2015, 12:47 AM
  2. Replies: 6
    Last Post: 04-30-2014, 02:42 AM
  3. Replies: 2
    Last Post: 04-28-2013, 05:55 PM
  4. [SOLVED] Index(match not pulling only 2 of five records
    By mmayna03 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-25-2012, 10:45 AM
  5. Replies: 5
    Last Post: 04-20-2012, 08:54 AM
  6. Utilizing INDEX/MATCH to match variables by column only
    By jeffreybrown in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 12-29-2011, 09:53 AM
  7. Pulling value from table based on two variables
    By nickymac in forum Excel General
    Replies: 2
    Last Post: 06-24-2011, 07:15 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