+ Reply to Thread
Results 1 to 4 of 4

Conditional sum

  1. #1
    Registered User
    Join Date
    10-31-2007
    Posts
    2

    Conditional sum

    Hi guys, first post...be gentle with me :P

    Im trying to pick up sum values from a column based on certain conditions, i have come up with the following but its giving me a 0 value.

    =SUM(IF('Data'!$C$2:$C$1144=01,IF('Data'!$D$2:$D$1144=18,IF('Data'!$E$2:$E$1144=3000,'Data'!$J$2:$J$1144,0),0)))

    so, from the above, i need the following to be true from my selection criteria.

    Column 1 - various values, but i need only those with a value of 1
    Column 2 - various values, but i need only those with a value of 18
    Column 1 - various values, but i need only those with a value of 3000
    Sum Column 4 - Sum the results where the conditions are met with the above 3 columns

    err help?

  2. #2
    Valued Forum Contributor Excelenator's Avatar
    Join Date
    07-25-2006
    Location
    Wantagh, NY
    Posts
    333
    =SUM(IF('Data'!$C$2:$C$1144=01,IF('Data'!$D$2:$D$1 144=18,IF('Data'!$E$2:$E$1144=3000,'Data'!$J$2:$J$ 1144,0),0)))
    Try this
    Please Login or Register  to view this content.
    ---------------------------------------------------
    ONLY APPLIES TO VBA RESPONSES WHERE APPROPRIATE
    To insert code into the VBE (Visual Basic Editor)
    1. Copy the code.
    2. Open workbook to paste code into.
    3. Right click any worksheet tab, select View Code
    4. VBE (Visual Basic Editor) opens to that sheets object
    5. You may change to another sheets object or the This Workbook object by double clicking it in the Project window
    6. In the blank space below the word "General" paste the copied code.

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,702
    Hello mushy,

    your formula looks valid to me, as long as all the values in columns C, D, E and J are numeric it should work OK.

    Formula needs to be confirmed with CTRL+SHIFT+ENTER....or perhaps you'd be better off with SUMPRODUCT, which will do the same thing without being array entered, i.e.

    =SUMPRODUCT(--('Data'!$C$2:$C$1144=1),--('Data'!$D$2:$D$1144=18),--('Data'!$E$2:$E$1144=3000),'Data'!$J$2:$J$1144)

  4. #4
    Registered User
    Join Date
    10-31-2007
    Posts
    2

    working, thank you

    I'm rather new to some of the functions within excel, SUMPRODUCT worked fine.

    Thank you for the replies and the help guys/gals, this now works fine.

+ 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