+ Reply to Thread
Results 1 to 8 of 8

calculating sum from a range of cells given a criteria

  1. #1
    Registered User
    Join Date
    07-06-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    17

    calculating sum from a range of cells given a criteria

    Hi,

    In the attached spreadsheet I am trying to return the sum from a range of cells in cell C6 between two selected dates the date cells are C3 and C4.

    Eg. In my example C6 ought to value 60,000

    Thanks
    TGP
    Attached Files Attached Files

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: calculating sum from a range of cells given a criteria

    I think your months would need to be entered as dates formatted as "MMMM",then use SUMPRODUCT

    = SUMPRODUCT((MONTHS>=C3)*(MONTHS<=C4)*(B9:B20))
    Attached Files Attached Files
    Last edited by royUK; 01-31-2011 at 06:23 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: calculating sum from a range of cells given a criteria

    If you're only ever looking forward (JUN -> DEC rather than DEC -> JUN) then:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    07-06-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: calculating sum from a range of cells given a criteria

    Hi Roy,

    Do you mean:

    =SUMIFS(B9:B20,MONTHS,C3,MONTHS,C4)

    Also, I don't appear to have "MMMM" as an option on my date formatting? Can you point me in the right direction please.

    TGP

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: calculating sum from a range of cells given a criteria

    format cell custom mmmm
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: calculating sum from a range of cells given a criteria

    I've changed the formula to sumproduct, "mmmm" would be a custom numberformat.

    DO has posted an alternative, not sure which would be best - DO's a formula guru

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: calculating sum from a range of cells given a criteria

    [removed - wouldn't work]
    Last edited by DonkeyOte; 01-31-2011 at 06:28 AM.

  8. #8
    Registered User
    Join Date
    07-06-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: calculating sum from a range of cells given a criteria

    Hi

    Thank you helping me, works perfectly for what I need.

    TGP

+ 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