+ Reply to Thread
Results 1 to 3 of 3

Looking up on 2 conditions, 1 being a date range

  1. #1
    Registered User
    Join Date
    08-19-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    1

    Question Looking up on 2 conditions, 1 being a date range

    Hi all,

    I have been doing an assignment at work and have found that my life could be greatly simplified if I could just figure out one formula!

    So here is the deal:

    1. I have two workbooks. Work book A has a great amount of detail regarding companies, fees, leaders and estimated payment date. Workbook B is a summarized workbook where we list the company and when we expected to be paid from them.

    2. Workbook A contains multiple duplicate companies that tell me for example:

    Company Name Fee Amount Estimated Pmt Date
    Comp. 1 $500 August 31, 2013
    Comp. 1 $250 September 15, 2013
    ....
    ....
    Comp. 2 50 September 15, 2013
    Comp. 3 100 August 31, 2013


    Workbook B looks like this:

    Company Name July August September October November

    Company 1 500 250
    Company 2 50
    Company 3 100

    What I would like is a formula that matches by company name and month date. I can manually go through and do this, but it is quite the task.

    I have tried an index function with a match formula involved and I have tried Vlookup. None of what I have tried can handle the date component of the formula I want since it needs to pick up all dates in August, September, etc.

    Any thoughts? All help is very much appreciated!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Looking up on 2 conditions, 1 being a date range

    Provide examples of the two workbooks, a small subset of the real data with sensitive data replaced by generic data. Make sure the "results" is manually mocked up from the sample data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Looking up on 2 conditions, 1 being a date range

    Where A2 = Company 1
    C1 = 7/1/2012, formatted to show only month
    D1 = 8/1/2012, etc
    etc

    =SUMPRODUCT(('[WorkbookA.xlsx]Sheet1!'$A$1:$A$5000=$A2)*('[WorkbookA.xlsx]Sheet1!'$C$1:$C$5000>=$C1)*('[WorkbookA.xlsx]Sheet1!'$C$1:$C$5000<$D1)*('[WorkbookA.xlsx]Sheet1!'$B$1:$B$5000))

    This finds all rows on workbook A that match workbook B's company in A2, then finds all dates that are >= current month, then all those less than next month, and on all those rows left over it totals the Column B.
    Last edited by daffodil11; 08-19-2013 at 06:07 PM. Reason: explanation

+ 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: 0
    Last Post: 04-11-2013, 04:42 PM
  2. Find earliest date if a range of conditions are met
    By Confused_Meme in forum Excel General
    Replies: 2
    Last Post: 03-02-2012, 04:39 PM
  3. Formula Problem with count under conditions within date range
    By txt_mess in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-03-2010, 11:04 AM
  4. Multiple Conditions with Date Range
    By caippers in forum Excel General
    Replies: 8
    Last Post: 08-18-2010, 10:38 AM
  5. Vlookup between two conditions between a date range
    By kmonette in forum Excel General
    Replies: 1
    Last Post: 04-20-2010, 02:50 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