Consulting

Results 1 to 10 of 10

Thread: Sum

  1. #1

    Sum

    I am trying to sum all the values relating to an artist. So for Artist1 I would want to add all the values in Column B that are next to Artist 1, so in this case the first 3 values in Column B. I have an inputbox already asking me what artist, but I dont know how to sum the values relating to the artist selected.

    So Columns A has
    Artist 1
    Artist 1
    Artist 1
    Artist 3
    Artist 3
    Artist 3
    Artist 9

    Columns B has
    1
    1
    2
    33
    44
    55
    44

    Thanks.

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Hi Tvercetti,
    Seems a good solution might be a sumif formula. See the attached and check the formula's in Column F. Hope this helps.

    Formula used: =SUMIF($A$2:$A$8,E3,$B$2:$B$8)
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    Great, thanks. I also wanted to do some more.
    I have added a column C with some more numbers relating to the artists in columns A

    I already have the input box where the user selects the artist and whether to sum column B or C. So I could select Artist 1, and have either the sum of column B or C relating to this artist.
    How do I do this? I want to show the end result in a message box. So e.g. The sum of (column B) for Artist 2 is ....)

    Thanks for all the help.

  4. #4
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Why don't you share what you have with us so we don't have to rebuild the whole thing just to help you?
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  5. #5
    Hi Lucas, im sorry, that would make sense.
    Im doing this for a friend of mine, and dont have the spreadsheet here.
    Can you put me on the right path maybe by explaining how this could be done?

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    How about a table like this?
    ____________________________________________
    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

  7. #7
    hi xld
    Sorry, a table like what?

  8. #8
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Sorry, I menat this http://cjoint.com/?kqvRfWX52H
    ____________________________________________
    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

  9. #9
    Great, thanks once again for your help
    I wanted some advice on how I could display select amount of information to the user. Lets just say I hide that table you created so the user cant see it.
    So if I were to get 2 inputs from the user that they want to know the (whatever column B represents) for Artist 9, how can I display a message what the value for those selections are, (eg. 44 from your table)?

    I know how to get the inputs, but dont know how to get the message.

  10. #10
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    a simple setup for what you want to do...see attached
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

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