+ Reply to Thread
Results 1 to 2 of 2

conditional sum based on date in two columns

  1. #1
    Registered User
    Join Date
    04-15-2013
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    1

    Question conditional sum based on date in two columns

    Hi,

    I have three columns where column A & B contains date and column C contains the number. I want Column D to populate with sum of column C where date in column A is less than column B.

    D1 is 2+3+4 (C2+C3+C4) as A2<B1,A3<B1,A4<B1
    D2 is 3+4 (C3+C4) as A3<B1,A4<B1

    and so on....

    Does any one had idea on how to achieve this?

    Col A Col B Col C Col D
    1 09-Jan-12 19-Feb-13 2 =c2 + C3 +C4
    2 10-Mar-12 19-Nov-12 2 7 =c3+c4
    3 24-Aug-12 15-Apr-13 3 9 = c4+c5
    4 18-Oct-12 15-Apr-13 4 5 = c5
    5 15-Mar-13 15-Apr-13 5 0


    Regards,
    Kanth

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: conditional sum based on date in two columns

    This works for your example

    =IF(OR(NOT(ISNUMBER(A2)),A2>B1),0,SUM(C2:INDEX(C2:$C$5,MATCH(B1,A2:$A$5))))
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

+ 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