Consulting

Results 1 to 4 of 4

Thread: Formula - Sumif,sumifs, aggregate

  1. #1
    VBAX Mentor Marcster's Avatar
    Joined
    Jun 2005
    Posts
    434
    Location

    Formula - Sumif,sumifs, aggregate

    Hi People,

    I have the below in a Table:
    ColA ColB ColC
    A 2.5 2.5
    B 5 5
    A 6 6
    A 200 0
    B 2 2
    C 36 36
    D 150 0
    E 56.96 56.96
    F 8.9 8.9
    E 125 0
    D 5 5
    D 8 8

    I'm after a formula that will Sum ColB where ColC <> o and this result will change to only include visible rows when ColA is filtered.

    Thanks,

  2. #2
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    is it?

    PHP Code:
    =SUMPRODUCT(SUBTOTAL(9,OFFSET($B$2:$B$1000,ROW($B$2:$B$1000)-ROW($B2),0,1)),--($C$2:$C$1000<>0)) 
    thanks Google
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

  3. #3
    VBAX Expert Leith Ross's Avatar
    Joined
    Oct 2012
    Location
    San Francisco, California
    Posts
    552
    Location
    Hello Marcster,

    A simpler and more flexible formula is
       =Aggregate(9,5,C2:C13)
    Sincerely,
    Leith Ross

    "1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG"

  4. #4
    VBAX Mentor Marcster's Avatar
    Joined
    Jun 2005
    Posts
    434
    Location
    Yep, this works: =Aggregate(9,5,C2:C13) Thanks Leith Ross, did look at Aggregate but had 3 instead of 5.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •