Consulting

Results 1 to 5 of 5

Thread: Sum if function

  1. #1
    VBAX Mentor
    Joined
    Aug 2011
    Posts
    353
    Location

    Sum if function

    I have an excel table that has different brokers in Column A, A1 has a drop down where you can select a certain broker. In column I, there are quantities. I would like to be able to sum all the quantities for a certain broker. So I would like to use the drop down, select a broker, and have a sum function at the bottom of the page that sums the quantity for that broker. However, I would like the function to be linked to each broker so anytime you select a broker in the drop down, the sum if automatically sums all the quanitites for the selected broker.

    Do you have any idea as to how to write this in excel? And i dont need a macro, just an =sumif in a cell. But im not sure how to make it automatically update when i select a different broker from the drop down.

    I have attached the sheet
    Attached Files Attached Files

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Try

    =SUBTOTAL(109,I:I)
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    I think it is

    =SUBTOTAL(9,I:I)

    plz correct me if I am wrong....

    Best regards

  4. #4
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    109 will react to manually hidden rows as well as filtered ones; 9 will not. That functionality was added in 2003, I think, so will not work in earlier versions.
    Be as you wish to seem

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    You are wrong. You wanted to total visible rows, 109 does just that as it says in the help file. As you have an xlsx file you must have 2007 or 2010 so it works.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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