+ Reply to Thread
Results 1 to 8 of 8

Sum of date with 2 conditions.

  1. #1
    Registered User
    Join Date
    11-16-2013
    Location
    World
    MS-Off Ver
    Excel 2007
    Posts
    5

    Sum of date with 2 conditions.

    Hi everybody,

    I'm trying to make the sum of all value in W when the date is between X and Y.

    =AND(Data!$X2<=D$1,Data!$Y2>=Stats!D$1) --> True and false Works
    =SUM(IF(Data!$X2<=D$1;SI(Data!$Y2>=Stats!D$1,Data!$W2,0),0)) --> Sum for one Row

    When i try with SumIf or Sumifs, it's doesn't work :
    =SUMIF(AND(Data!$X:$X<=Stats!D$1,Data!$Y:$Y>=Stats!D$1), True, Data!$W:$W)
    =SUMIFS(Data!$W:$W, Data!$X:$X, "<="&Stats!D$1,Data!$Y:$Y,">="&Stats!D$1)

    Do you have an idea ?
    Last edited by Carly1985; 11-16-2013 at 09:20 PM. Reason: D$1 = Stats!D$1

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Sum of date with 2 conditions.

    Quote Originally Posted by Carly1985 View Post
    =SUMIFS(Data!$W:$W, Data!$X:$X, "<="&D$1,Data!$Y:$Y,">="&Stats!D$1)
    Your SUMIF syntax won't work but the SUMIFS looks OK, what result do you get? Are Stats!D$1 and D$1 on different sheets or are they the same thing?
    Audere est facere

  3. #3
    Registered User
    Join Date
    11-16-2013
    Location
    World
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Sum of date with 2 conditions.

    No it's on the same sheet. I added in order to make it clear, and I forgot one.

    The result is "0".

  4. #4
    Registered User
    Join Date
    11-16-2013
    Location
    World
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Sum of date with 2 conditions.

    I try with value :
    X = Y = D1, =SUMIFS(Data!$W:$W, Data!$X:$X, "="&D$1,Data!$Y:$Y,"="&Stats!D$1) --> The value is good

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

    Re: Sum of date with 2 conditions.

    it might help if you uploaded a small sample, as daddylonglegs said, your sumifs formula seems to be fine, so not sure where the problem is
    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

  6. #6
    Registered User
    Join Date
    11-16-2013
    Location
    World
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Sum of date with 2 conditions.

    Exemple.xlsx

    I can upload the original file, because it is very big and it contain the database query. But this file is an exemple.

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

    Re: Sum of date with 2 conditions.

    Two problems I see
    1> the values in data columns X and Y, are mostly text, for what you are trying they should be numbers
    2> when converted, the Y column values are all Larger Than the X column values, so you never reach a TRUE/TRUE state for the SUMIFS
    (if X>=B1 and Y is larger than X, then Y CANNOT be <B1)
    so get the numbers as numbers in X&Y of Data Sheet
    then in B2 of stats:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Drag across
    this gives the following results:
    0 3 9 4 3 3 0 0 0 0 0 0 0 0

    See attached

    Hope this helps
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    11-16-2013
    Location
    World
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Sum of date with 2 conditions.

    Thanks, i check tomorow

+ 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. Looking up on 2 conditions, 1 being a date range
    By smitha00 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-19-2013, 06:04 PM
  2. Replies: 0
    Last Post: 04-11-2013, 04:42 PM
  3. If Conditions then Date
    By Vincent.Eymard in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-01-2010, 05:33 AM
  4. Excel 2007 : Date Conditions
    By DMAN11 in forum Excel General
    Replies: 2
    Last Post: 02-13-2010, 05:03 PM
  5. Date Formula W/ Conditions
    By Jackson1008 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-25-2008, 12:44 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