+ Reply to Thread
Results 1 to 7 of 7

Adding values from different columns from specific date ranges

  1. #1
    Forum Contributor
    Join Date
    11-01-2013
    Location
    Atlanta, GA USA
    MS-Off Ver
    Excel 2010
    Posts
    115

    Adding values from different columns from specific date ranges

    We have a variety of payments that we receive during a given month. I'd like to be able to collect all payments that are entered in multiple columns within a specific date range. To clarify / simplify, here's a simple table that represents my sheet:

    COLUMN A COLUMN C COLUMN E

    ROW 1 DATE AMT1 AMT2
    ROW 2 9/22/2013 25.00
    ROW 3 9/30/2013 1000.00
    ROW 4 10/12/2013 50.00
    ROW 5 10/19/2013 1250.00
    ROW 6 10/28/2013 75.00
    ROW 7 11/1/2013 1500.00
    ROW 8 11/2/2013 100.00

    So, what I want is to be able to add the values in AMT1 and/or AMT2 that fall between 9/1/13 - 9/30/13 and save that value in CELL A10.

    Then the same thing, but between dates 10/1/13 - 10/31/13 and save in CELL A11.

    ... and again for 11/1/13 - 11/30/13 and save in CELL A12.


    I hope this is clear. Thank you for helping!!

  2. #2
    Forum Contributor
    Join Date
    11-01-2013
    Location
    Atlanta, GA USA
    MS-Off Ver
    Excel 2010
    Posts
    115

    Re: Adding values from different columns from specific date ranges

    Darn, the formatting went bad!! Sorry.

    Maybe this works better:

    EXCEL sheet1.jpg

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Adding values from different columns from specific date ranges

    Try this...


    Data Range
    A
    B
    C
    D
    E
    1
    DATE
    ----
    AMT1
    ----
    AMT2
    2
    9/22/2013
    25
    3
    9/30/2013
    1000
    4
    10/12/2013
    50
    5
    10/19/2013
    1250
    6
    10/28/2013
    75
    7
    11/1/2013
    1500
    8
    11/2/2013
    100
    9
    10
    9/1/2013
    1025
    11
    10/1/2013
    1375
    12
    11/1/2013
    1600


    Enter the 1st of the month dates as shown.

    Enter this formula in B10 and copy down as needed:

    =SUMPRODUCT(--(TEXT(A$2:A$8,"mmmyy")=TEXT(A10,"mmmyy")),C$2:C$8+E$2:E$8)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Contributor
    Join Date
    11-01-2013
    Location
    Atlanta, GA USA
    MS-Off Ver
    Excel 2010
    Posts
    115

    Re: Adding values from different columns from specific date ranges

    Tony, that is absolutely awesome! I'm curious what the two dashes do at the front of the formula??

    Thank you very much. Much appreciated!

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Adding values from different columns from specific date ranges

    The SUMPRODUCT function works with numbers. It multiplies arrays of numbers then sums the result of that multiplication.

    This expression returns an array of either TRUE or FALSE:

    TEXT(A$2:A$8,"mmmyy")=TEXT(A10,"mmmyy")

    Since SUMPRODUCT works with numbers we have to convert that array of TRUE or FALSE to numbers.

    The double unary minus -- is one way to do that.

    --TRUE = 1
    --FALSE = 0

    Then, SUMPRODUCT is able to do the array multiplication. It might look something like this:

    1 * 25 = 25
    1 * 1000 = 1000
    0 * 50 = 0
    0 * 1250 = 0
    0 * 75 = 0
    etc
    etc

    See this for more on the power of the SUMPRODUCT function:

    http://xldynamic.com/source/xld.SUMPRODUCT.html

  6. #6
    Forum Contributor
    Join Date
    11-01-2013
    Location
    Atlanta, GA USA
    MS-Off Ver
    Excel 2010
    Posts
    115

    Re: Adding values from different columns from specific date ranges

    Nice explanation! I get it now. Thank you for taking the time!!

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Adding values from different columns from specific date ranges

    You're welcome. Thanks for the feedback!

+ 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. Formula for adding specific values based on data in other columns
    By Adelade in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-08-2013, 05:15 AM
  2. Replies: 4
    Last Post: 06-28-2012, 07:08 AM
  3. Counting Unique values from specific date ranges
    By SMDNovice in forum Excel General
    Replies: 3
    Last Post: 12-09-2011, 04:42 PM
  4. Sum values on specific date within a daterange (multiple ranges)
    By Fredrik S in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-26-2008, 05:47 AM
  5. Adding values within date ranges
    By ktf71096 in forum Excel General
    Replies: 3
    Last Post: 02-27-2007, 12:07 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