+ Reply to Thread
Results 1 to 3 of 3

SUMIF Command

  1. #1
    Registered User
    Join Date
    04-28-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    9

    SUMIF Command

    Hi,

    Is is possibe to have a SUMIF with two citeria?

    For instance to SUMIF when a range fall in between two values?

    Like SUMIF (A1:A7, "AND(>x,<x+5)",B1:B7)??

    I've tried and it doesn't seem to work.

    Any Suggestions???

    P.S. I'm trying to do this with dates, so far I 've tried by converting the dates to numbers and doing the above command
    Last edited by pimpger; 05-14-2009 at 12:04 PM.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: SUMIF Command

    Good morning pimpger
    Quote Originally Posted by pimpger View Post
    Is is possibe to have a SUMIF with two citeria?
    For instance to SUMIF when a range fall in between two values?
    Using Excel 2007 you can use more than one criteria in SumIf formulae.

    As we're not, we can use SumProduct, thus :
    =SUMPRODUCT(--(B1:B10>DATEVALUE("01/01/09")),--(C1:C10<DATEVALUE("28/07/09")),(A1:A10))

    This will total any numbers in column A, where column B is greater than 01/01/09 and column C is less than 28/07/09.

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

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

    Re: SUMIF Command

    The other alternative is to use 2 SUMIF's

    =SUMIF(A1:A17,">"&x,B1:B7)-SUMIF(A1:A17,">="&x+5,B1:B7)

    If you ever find your two criteria to be constant (less common) the above approach can be shortened in terms of syntax, eg:

    =SUMIF(A1:A17,{">2",">=7"},B1:B17)*{1,-1}

+ 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