+ Reply to Thread
Results 1 to 5 of 5

Sum exact range based on criteria

  1. #1
    Registered User
    Join Date
    05-14-2009
    Location
    Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    10

    Sum exact range based on criteria

    Hi, I would appreciate if someone could help me out with this Excel problem. I would like to sum a quarter's total based on the user's date input.

    Here's what the data would look like:

    Month Total
    Jan 10
    Feb 20
    Mar 30
    Apr 40
    May 50
    Jun 60
    Jul 70
    Aug 80
    Sep 90
    Oct 100
    Nov 110
    Dec 120

    For example, May total should be 90, ie Apr + May
    Sep should be 240, ie Jul + Aug + Sep
    Oct should be 100, ie Oct totals only

    I would appreciate any input. Thanks so much!

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: Sum exact range based on criteria

    Presuming your table starts at cell A1

    in C2, and copied down

    =SUM(OFFSET(B2,0,0,CHOOSE(1+MOD(MATCH(A2,$A$2:$A$13,0),3),-3,-1,-2),1))
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Contributor
    Join Date
    03-31-2009
    Location
    Childers QLD, Australia
    MS-Off Ver
    Excel 2003, 2007 & 2013
    Posts
    128

    Re: Sum exact range based on criteria

    Hi,

    Based your request, I believe the attached sheet provides a simple summary, where the monthly totals have already been compiled.

    Should you wish to calculate the number of transactions for the month, a different method would be used to achieve the same summary result.

    Cheers

    Tomy
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-14-2009
    Location
    Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Sum exact range based on criteria

    Quote Originally Posted by sweep View Post
    Presuming your table starts at cell A1

    in C2, and copied down

    =SUM(OFFSET(B2,0,0,CHOOSE(1+MOD(MATCH(A2,$A$2:$A$13,0),3),-3,-1,-2),1))
    Worked like a charm! Thank you very much!

  5. #5
    Registered User
    Join Date
    05-14-2009
    Location
    Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Sum exact range based on criteria

    Quote Originally Posted by TonyB51 View Post
    Hi,

    Based your request, I believe the attached sheet provides a simple summary, where the monthly totals have already been compiled.

    Should you wish to calculate the number of transactions for the month, a different method would be used to achieve the same summary result.

    Cheers

    Tomy
    Thank you Tomy! So far, no need to do the transactions for the month as I only get the totals and work from those data. Whew!

+ 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