+ Reply to Thread
Results 1 to 3 of 3

XL Formula help required- sum a range of cells which meet a specific criteria

  1. #1
    Registered User
    Join Date
    11-01-2012
    Location
    Melbourne Australia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question XL Formula help required- sum a range of cells which meet a specific criteria

    I have the following data in XL:

    Drive Letter Name Total Cap Free Cap Lun_ID RAID LVL RAID_GRP
    C -- 140 38 -- -- --
    D DATA 1600 435 50 5 4
    L LOG 300 23 30 1/0 3


    50:05:08:b2:00:be:de:e2 \\.\Scsi2
    50:05:08:b2:00:be:de:e3 \\.\Scsi3

    Drive Letter Name Total Cap Free Cap Lun_ID RAID LVL RAID_GRP
    C -- 280 99 -- -- --
    D DATA2 573 277 191 5 19


    50:05:08:b2:00:bf:22:a2 \\.\Scsi2
    50:05:08:b2:00:bf:22:a3 \\.\Scsi3

    Drive Letter Name Total Cap Free Cap Lun_ID RAID LVL RAID_GRP
    C -- 280 242 -- -- --
    D DATA 1200 481 200 5 4
    L LOG 30 30 31 1/0 3


    I want to create a formula which looks at the RAID_GRP column, find anything which matches "4" and sums the values in the Total Cap column. For example, there are two entries for RAID_GRP = 4, where the Total Cap column equals: 1600 + 1200. My formula should thus give me a result of 2800.

    If I create another formula where RAID_GRP = "3", then my formula should give me 300 + 30 = 330.

    I tried the following dynamic formula:

    =SUM(((I14:I42=4)*1)*(E14:E42))

    Entered using CTRL-SHFT-ENTER, but I'm getting "#Value" as when it gets to the text parts of a cell, it cannot compute it. Thus, for this formula, I'm getting:

    =SUM(({FALSE;TRUE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE;TRUE;FALSE}*1)*{140;1600;30;0;0;0;0;0;"Total Cap";280;573;0;0;0;0;0;"Total Cap";280;1200;30})

    Which then equates to:

    =SUM({0;1;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;1;0}*{140;1600;30;0;0;0;0;0;"Total Cap";280;573;0;0;0;0;0;"Total Cap";280;1200;30})

    ....and....

    =SUM({0;1600;0;0;0;0;0;0;#VALUE!;0;0;0;0;0;0;0;#VALUE!;0;1200;0})

    So, I thus need to "remove" the text values from the equation, unless there is a better way to do this.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: XL Formula help required- sum a range of cells which meet a specific criteria

    try using sumifS() without seeing a sample of you're data, i cant give you the syntax, so if you still have a problem, upload a sample workbook please
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    11-01-2012
    Location
    Melbourne Australia
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: XL Formula help required- sum a range of cells which meet a specific criteria

    I was over-engineering the concept and found this as the answer:

    Try: =SUMIF(I1:I21,4,E1:E21)

    Where I1:I21 is the RAID_GRP column and E1:E21 the Total Cap column.

    This works sweet! Thanks for your help!

+ 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