+ Reply to Thread
Results 1 to 8 of 8

"If And If then sum" formula

  1. #1
    Registered User
    Join Date
    08-13-2008
    Location
    Copenhagen
    Posts
    24

    "If And If then sum" formula

    Does anybody have a suggestion to how it is possible to test two criterias (in complete columns) and return the sum of all cells meeting both criterias?

    FX: If(A:A=D24) And If(B:B=C24) Then sum


    appreciate the effort
    Søren

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    What range is being summed?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    08-13-2008
    Location
    Copenhagen
    Posts
    24
    Sorry..

    FX: If(A:A=D24) And If(B:B=C24) Then sum C:C

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try:

    =Sumproduct((A1:A100=D24)*(B1:B100=C24),C1:C100)

    adjust ranges to suit.

    Note: You can't use whole column references with Sumproduct unless you use XL2007

  5. #5
    Registered User
    Join Date
    08-13-2008
    Location
    Copenhagen
    Posts
    24
    Works like a charm

    Cheers mate

  6. #6
    Registered User
    Join Date
    09-21-2006
    Posts
    35
    I tried this just to learn how it works and I get a "zero" as my answer. I'm not sure it is reading the "=D24" and "=c24" components correctly. Any thoughts?

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    The formula looks in range A1:A100 looking for matches to whatever is in D24 and it looks in range B1:B100 for matches to what's in C24.

    Where there are matches in both columns (in the same rows), it will sum up values in column C1:C100...

    So what you enter in C24 and D24 is what you want to look for in A1:100 and B1:B100... the matches have to next to each other...

  8. #8
    Registered User
    Join Date
    09-21-2006
    Posts
    35
    Quote Originally Posted by NBVC
    The formula looks in range A1:A100 looking for matches to whatever is in D24 and it looks in range B1:B100 for matches to what's in C24.

    Where there are matches in both columns (in the same rows), it will sum up values in column C1:C100...

    So what you enter in C24 and D24 is what you want to look for in A1:100 and B1:B100... the matches have to next to each other...
    I found my mistake --- it was something pretty simple and stupid..............

+ 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