+ Reply to Thread
Results 1 to 23 of 23

Lookup formula with multiple criteria - find if date is within range

  1. #1
    Registered User
    Join Date
    09-07-2009
    Location
    Brazil
    MS-Off Ver
    Excel for Mac
    Posts
    12

    Talking Lookup formula with multiple criteria - find if date is within range

    Hi.
    I need some help from you experts with a lookup formula (please check the attached image and/or xls).

    Let me explain what I need in steps:

    1. I have payment contracts with my customers.

    2. The contract list has the following information:

    Column A = Customer name
    Column B = Contract Start Date
    Column C = Contract End Date
    Column D = Contract Payment Value

    Each company can have only one contract per month, and when each contract expires, a new one, with a new Payment value begins.

    3. Each contract have a duration of 3 months, like, 01/01/2015 to 31/03/1015 (date format dd/mm/yyyy).

    4. Finally, what I need is to make a yearly table that shows the payment value for each month (January = 50.00, February = 50.00, March = 50.00, April = 100.00... )

    So, Let's assume that I want to show the February/2015 payment for Customer A, from my Contracts list. How to I do it?

    After hours of "Googling" and trial and error, I still couldn't find out how to do it.

    If I was using exact dates, a simple INDEX MATCH function would be enough. But it needs to look for CUSTOMER A's February/2015 (in fact 01/02/2015) payment, in a list containing list containing date ranges, and not exact dates.

    Thanks in advance!
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,605

    Re: Lookup formula with multiple criteria - find if date is within range

    Formula in G3, then drag across
    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Lookup formula with multiple criteria - find if date is within range

    G3=sumproduct(($a$3:$a$7=$f3)*($b$3:$b$7<=g$2)*($c$3:$c$7>=g$2)*($d$3:$d$7))
    try this and copy across
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Registered User
    Join Date
    09-07-2009
    Location
    Brazil
    MS-Off Ver
    Excel for Mac
    Posts
    12

    Re: Lookup formula with multiple criteria - find if date is within range

    Quote Originally Posted by kvsrinivasamurthy View Post
    Formula in G3, then drag across
    Please Login or Register  to view this content.
    Hi, kvsrinivasamurthy. Thanks for your help! But this formula is only showing the "Payment" for the exact dates of "Monthy Payment table". I need to show the payment value for each month.

  5. #5
    Registered User
    Join Date
    09-07-2009
    Location
    Brazil
    MS-Off Ver
    Excel for Mac
    Posts
    12

    Re: Lookup formula with multiple criteria - find if date is within range

    Quote Originally Posted by nflsales View Post
    G3=sumproduct(($a$3:$a$7=$f3)*($b$3:$b$7<=g$2)*($c$3:$c$7>=g$2)*($d$3:$d$7))
    try this and copy across
    Hi, NFLSALES. It solved everything! Thank you very much! As kvsrinivasamurthy solution, this is a different formula than I was expecting, so I will take a closer look and try to learn how does it work.

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: Lookup formula with multiple criteria - find if date is within range

    This if for start date within month of Monthly payment (i.e start 31/1/2015 or 1/1/2015, both are counted whole month Jan/2015 payment)

    Please Login or Register  to view this content.
    Quang PT

  7. #7
    Registered User
    Join Date
    09-07-2009
    Location
    Brazil
    MS-Off Ver
    Excel for Mac
    Posts
    12

    Re: Lookup formula with multiple criteria - find if date is within range

    Quote Originally Posted by bebo021999 View Post
    This if for start date within month of Monthly payment (i.e start 31/1/2015 or 1/1/2015, both are counted whole month Jan/2015 payment)

    Please Login or Register  to view this content.
    Thanks, Bebo! Your formula is a little different from the above and also fits my needs.

  8. #8
    Registered User
    Join Date
    09-07-2009
    Location
    Brazil
    MS-Off Ver
    Excel for Mac
    Posts
    12

    Re: Lookup formula with multiple criteria - find if date is within range

    So, a INDEX + MATCH + some other functions would never solve this?

  9. #9
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,296

    Re: Lookup formula with multiple criteria - find if date is within range

    An array formula (Ctrl+Shift+Enter).
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    09-07-2009
    Location
    Brazil
    MS-Off Ver
    Excel for Mac
    Posts
    12

    Re: Lookup formula with multiple criteria - find if date is within range

    Quote Originally Posted by Czeslaw View Post
    An array formula (Ctrl+Shift+Enter).
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    That's more os less where I could get, but as I said before, it is only showing the "Payment" for the exact dates of "Monthy Payment table". I need to show the payment value for each month.

    Until now, SUMPRODUCT seems to be the only way, but I may be wrong.

  11. #11
    Registered User
    Join Date
    09-07-2009
    Location
    Brazil
    MS-Off Ver
    Excel for Mac
    Posts
    12

    Re: Lookup formula with multiple criteria - find if date is within range

    Quote Originally Posted by nflsales View Post
    G3=sumproduct(($a$3:$a$7=$f3)*($b$3:$b$7<=g$2)*($c$3:$c$7>=g$2)*($d$3:$d$7))
    try this and copy across
    Hi, NFLSALES. I've studied SUMPRODUCT function itself, and based on your solution, now I understand how does it work. But what if I had text instead of a numerical value? In fact, in my real spreadsheet have other columns with text information which I also need to get.

  12. #12
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,371

    Re: Lookup formula with multiple criteria - find if date is within range

    Maybe somthing like this?
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    09-07-2009
    Location
    Brazil
    MS-Off Ver
    Excel for Mac
    Posts
    12

    Re: Lookup formula with multiple criteria - find if date is within range

    Quote Originally Posted by azumi View Post
    Maybe somthing like this?
    Hi Azumi. It is an interesting solution. But it works only with numbers and not with Text.

  14. #14
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,371

    Re: Lookup formula with multiple criteria - find if date is within range

    I don't know what you mean about text, but another try with 2 formulas
    Attached Files Attached Files

  15. #15
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,605

    Re: Lookup formula with multiple criteria - find if date is within range

    See the changed formula.file attached.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 04-02-2015 at 12:10 AM.

  16. #16
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Lookup formula with multiple criteria - find if date is within range

    Attach a sample file where you are not getting result

  17. #17
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,296

    Re: Lookup formula with multiple criteria - find if date is within range

    Another nonmassive formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    09-07-2009
    Location
    Brazil
    MS-Off Ver
    Excel for Mac
    Posts
    12

    Re: Lookup formula with multiple criteria - find if date is within range

    Quote Originally Posted by azumi View Post
    I don't know what you mean about text, but another try with 2 formulas
    Hello, AZUMI. What I meant by TEXT, is to have, letters or any other character in the "Payment" Column: Instead of numbers like 100.00, 150.00, 200.00, I have TEXT and specials characters, like: AAA, BBB, C$C...
    And your formula does exactly that! Thank you very much

  19. #19
    Registered User
    Join Date
    09-07-2009
    Location
    Brazil
    MS-Off Ver
    Excel for Mac
    Posts
    12

    Re: Lookup formula with multiple criteria - find if date is within range

    Quote Originally Posted by nflsales View Post
    Attach a sample file where you are not getting result
    For sure. Here it is:
    Attached Images Attached Images
    Attached Files Attached Files

  20. #20
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Lookup formula with multiple criteria - find if date is within range

    Try this in G3, Drag down and sideways to right:-
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Check the attached file:-
    Attached Files Attached Files
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  21. #21
    Registered User
    Join Date
    09-07-2009
    Location
    Brazil
    MS-Off Ver
    Excel for Mac
    Posts
    12

    Re: Lookup formula with multiple criteria - find if date is within range

    Quote Originally Posted by Czeslaw View Post
    Another nonmassive formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Great solution, CZESLAW. It works exactly as I expected. thank you!

  22. #22
    Registered User
    Join Date
    09-07-2009
    Location
    Brazil
    MS-Off Ver
    Excel for Mac
    Posts
    12

    Re: Lookup formula with multiple criteria - find if date is within range

    Quote Originally Posted by Vikas_Gautam View Post
    Try this in G3, Drag down and sideways to right:-
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Check the attached file:-
    Hello, Vikas. I like this SUMIFS formula. Solves when we need to lookup for a NUMBER, and other experts here are suggesting good alternatives for when we need to lookup for TEXT.

  23. #23
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Lookup formula with multiple criteria - find if date is within range

    NO Problems.. Maz.. enjoy the solutions..!


+ 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] Find the MIN of a date range with multiple criteria
    By philozelda in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-17-2014, 06:59 PM
  2. [SOLVED] Lookup value based on date range and multiple criteria
    By jsclark in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-07-2014, 06:23 PM
  3. Excel Lookup with multiple criteria and date range match
    By denniswtlx in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-06-2013, 02:25 PM
  4. Replies: 11
    Last Post: 02-07-2013, 02:22 AM
  5. Replies: 1
    Last Post: 05-16-2011, 05: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