+ Reply to Thread
Results 1 to 4 of 4

Summing values for a particular date range and putting into one cell.

  1. #1
    Registered User
    Join Date
    05-23-2011
    Location
    Alabama, USA
    MS-Off Ver
    Microsoft 365 Family
    Posts
    46

    Summing values for a particular date range and putting into one cell.

    I have a column of dates that span many years. Each of the dates has a corresponding amount of money that was spent on that day. I need a formula that will take only a certain year (or part of a year) and then sum the amount of money spent only on those days and put that value into one cell.

    I have tried sum, sumif, ......and all sorts of formulas.

    Any suggestions for this one? Do you need to know more?

    Thanks in advance.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Summing values for a particular date range and putting into one cell.

    you tried sumif(), but did you try sumifS()?

    sumifS() allows for multiple criteria, give it a shot and let me know how you make out?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    05-23-2011
    Location
    Alabama, USA
    MS-Off Ver
    Microsoft 365 Family
    Posts
    46

    Re: Summing values for a particular date range and putting into one cell.

    Okay, so when I started a whole new worksheet and put in some examples, it worked easily and perfectly. I attached the example but basically I came up with this formula:

    =SUMIFS($D$2:$D$28,$B$2:$B$28,"<=12/31/2007",$B$2:$B$28,">=1/1/2007") for the amount of money spent in 2007,

    =SUMIFS($D$2:$D$28,$B$2:$B$28,"<=12/31/2008",$B$2:$B$28,">=1/1/2008") for the amount of money spent in 2008, and

    =SUMIFS($D$2:$D$28,$B$2:$B$28,">=07/1/2008",$B$2:$B$28,"<=1/31/2009") for the amount of money between July, 2008 and January, 2009 (including those months.)

    So, my problem now is this:
    Why won't that work in my original spreadsheet? I'll tell you why: because of some formatting problem, that's why! I spent hours on this formula, put in a DATE, DATE RANGE, ...all sorts, but I've come to believe that it is just because somewhere in the data I cannot tell the format. Not just simple stuff, but rather, if there is data validation, or formatted so that some of the values disappear (like for example, (0;-0;;@), or if one cell is using another's answer and I can't tell because nothing shows up when I try to see if there are any precedents or dependents on those cells, or even if I copy a cell or column and then paste it incorrectly so that the value..............know what? My question has changed to how do I clear my formatting or rules, or codes or conditions or validations back to when I opened a new spreadsheet and started working fresh?

  4. #4
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Summing values for a particular date range and putting into one cell.

    Select Entire worksheet (click on the right/down pointing triangle, just above the row numberes, and just to the the right of the columns),format cells, number, general,ok; CF, Clear Rules, Entire Sheet, ok;
    BUT, neither one will affect the outcome..formatting is only for visual presentation, the underlying value (which is used for any calculations referencing that cell) remains the same...
    Your attachment appears to have failed, so can not offer any specific explanation or solution to your problem
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

+ 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