+ Reply to Thread
Results 1 to 4 of 4

Calculate max quantity bought if range of dates<days determined by another cell.

  1. #1
    Registered User
    Join Date
    07-08-2015
    Location
    Spain
    MS-Off Ver
    2010
    Posts
    25

    Calculate max quantity bought if range of dates<days determined by another cell.

    In column A the codes of products are given. B is the number of days by which if the date range is < this number, the quantities should be added. Max quantity is the sum of such quantities, given date A2-A1<B2.
    However, this only calculates the max quantity for 2 consecutive dates. I need a formula for a varying date range, within each different code.
    The attached file makes it easier to understand.
    Please help!!
    Attached Files Attached Files

  2. #2
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Calculate max quantity bought if range of dates<days determined by another cell.

    Hi,

    You need to explain in detail the logic behind 'Quantity' & 'Max Quantity'.

    Also,
    B is the number of days by which if the date range is < this number
    , what you mean by this?

  3. #3
    Registered User
    Join Date
    07-08-2015
    Location
    Spain
    MS-Off Ver
    2010
    Posts
    25

    Re: Calculate max quantity bought if range of dates<days determined by another cell.

    'Quantity' = number of items bought for each date given in Column C.
    Codes represent different items. ie; 1001=apples, 1002=bananas...
    Max Quantity = sum of quantities for a certain item, if the range of dates the item was bought in is less than 61days.
    However, the formula I have used, doesn't allow for a range, just 2 consecutive date differences.

  4. #4
    Registered User
    Join Date
    07-08-2015
    Location
    Spain
    MS-Off Ver
    2010
    Posts
    25

    Re: Calculate max quantity bought if range of dates<days determined by another cell.

    Other forumlas I've used in other parts of the spreadsheet are:
    =IF(A2<>"";MAX(OFFSET(L2:M2;0;0;IFERROR(MATCH("*";OFFSET(A3;0;0;COUNTA(L:L)-ROW()+1);0);COUNTA(L:L)-ROW()+1)));"")

    =IF(AND(MAX(OFFSET(L2:M2;0;0;IFERROR(MATCH("*";OFFSET(A3;0;0;COUNTA(L:L)-ROW()+1);0);COUNTA(L:L)-ROW()+1)))>1;A2<>"");ROUND(MAX(OFFSET(L2:M2;0;0;IFERROR(MATCH("*";OFFSET(A3;0;0;COUNTA(L:L)-ROW()+1);0);COUNTA(L:L)-ROW()+1)))/2;0);H2)


    Just in case they serve as any help.

+ 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. Calculate Days Past in a Range of Dates
    By BrownBoy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-02-2014, 10:56 AM
  2. [SOLVED] Calculate days between 2 dates and returning a blank cell if there is missing data
    By j_dinh in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-14-2013, 01:53 AM
  3. [SOLVED] How to calculate Days between two dates?
    By PERE in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-05-2013, 11:00 PM
  4. [SOLVED] Construct a formula on a pre-determined cell for a pre-determined duration of cells
    By Shaun Gemiver in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-03-2013, 11:14 AM
  5. Replies: 1
    Last Post: 11-01-2012, 03:41 PM
  6. [SOLVED] Calculate the Bonus units according to the quantity of the units bought (Help)
    By mo_naf in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-15-2012, 05:51 PM
  7. Calculate the days between 2 dates
    By sats43 in forum Excel General
    Replies: 4
    Last Post: 05-19-2010, 04:26 AM
  8. Calculate days between dates
    By sunita_shaw in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-07-2006, 03:28 PM

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