+ Reply to Thread
Results 1 to 7 of 7

SumIF a date is with in 90 days of todays date before or after

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-31-2009
    Location
    Lincoln, USA
    MS-Off Ver
    Excel 2007 and excel 2010
    Posts
    142

    SumIF a date is with in 90 days of todays date before or after

    This one should be easy for you all.

    I have todays date in cell A2

    I have a range of dates in a row 4 and numbers below each date in row 6.

    What i want is to Sum the numbers below the dates in row 6 if the date in row 4 is with in 90 days before or after the date in cell A2.

    Example

    todays date is 10-29-09

    05-15-09 , 08-15-09 , 09-15-09 , 12-15-09 , 04-15-10
    1 , 2 , 1 , 1 , 1


    The answer i should get is 4 since only 3 dates fall 90 days before or after todays date.

    Thoughts?
    Last edited by fireguy7; 10-29-2009 at 05:51 PM.

  2. #2
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: SumIF a date is with in 90 days of todays date before or after

    Try
    =SUMPRODUCT(--($A$4:$E$4>$C$2),--($A$4:$E$4<$D$2),$A$5:$E$5)
    which is similar to =SUMPRODUCT(--($A$4:$E$4>(NOW()-90)),--($A$4:$E$4<(NOW()+90)),$A$5:$E$5)
    See the attachement.

    Note: In the attachement I have set the format of the dates to numeric (,) values. You can change these back to Date Format.

    In excel 2007 you can use SUMIFS. I do not have that luxery
    Attached Files Attached Files
    Last edited by rwgrietveld; 10-29-2009 at 05:40 PM.
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,645

    Re: SumIF a date is with in 90 days of todays date before or after

    Try this:

    =SUMPRODUCT(--(ABS(C4:AH4-$C$1)<90),C6:AH6)

    (adjust ranges.... C4-AH4 are dates, C1 is today, C6:AH6 are values)

  4. #4
    Forum Contributor
    Join Date
    07-31-2009
    Location
    Lincoln, USA
    MS-Off Ver
    Excel 2007 and excel 2010
    Posts
    142

    Re: SumIF a date is with in 90 days of todays date before or after

    simple and to the point i like

    Thanks again.

  5. #5
    Registered User
    Join Date
    08-27-2010
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2003
    Posts
    13

    Include data if a date less than 6 weeks old.

    I need to only include data from rows with a date less than six weeks ago? I've been trying to subtract from TODAY, but getting errors. Anyone have a solution?

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,645

    Re: SumIF a date is with in 90 days of todays date before or after

    bcullers... please check the rules:

    2. Don't post a question in the thread of another member -- start your own. If you feel it's particularly relevant, provide a link to the other thread.

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,645

    Re: SumIF a date is with in 90 days of todays date before or after

    And also some useful tips:

    Want to get your question answered quickly?

    - Ensure your question is not too vague. Don't assume anyone is familiar with your problem. While you can upload small attachments, describe your problem in the body of the post. We are fortunate to have several Excel gurus, but few mind-readers.

    - On the other hand, skip irrelevant details. Be descriptive and concise. Short, direct, and to-the-point questions with apt thread titles are almost always answered promptly.

    - Keep the scope reasonably narrow. Questions like, "How do I set up an accounting system in Excel?" might be a long time waiting.

    - Explain what you've already tried. ("Calculation is set to automatic, but formulas still don't compute") so helpers don't waste your time or theirs.

    - Post a WORKBOOK. Nobody wants to type data from a picture or paste text from your post into a spreadsheet as a prelude to helping. To attach a file, push the button with the paperclip (or scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.
    If your question has not been answered within a day, consider adding another post with any additional information you believe is relevant. If you think your post is good as is, just reply to your own thread with the words "Bump no response", which will bring it to the top of the forum.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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