+ Reply to Thread
Results 1 to 8 of 8

count number of element

  1. #1
    Forum Contributor iscar_marius's Avatar
    Join Date
    12-19-2008
    Location
    germany
    MS-Off Ver
    2000 and 2003
    Posts
    221

    count number of element

    For example, I have 2 columns:
    john------2
    rick-------1
    andrew---3
    john------5

    I want on the third and fourth column the result like this:
    john------7
    rick-------1
    andrew---3

    I want to count automatically the number of elements taken by john, rick and andrew. I don't know how, it's driving me crazy . Please help!

    PS:
    Sorry for my english!
    Last edited by iscar_marius; 12-20-2008 at 07:29 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Have a look at Sumif() function in Excel help files.

    e.g. In D1 enter, =Sumif($A$1:A$4,C1,$B$1:$B$4)

    where A1:B4 contain your original data and C1 contains the first name to sum up for...

    copy formula down.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor iscar_marius's Avatar
    Join Date
    12-19-2008
    Location
    germany
    MS-Off Ver
    2000 and 2003
    Posts
    221
    Quote Originally Posted by NBVC View Post
    Have a look at Sumif() function in Excel help files.

    e.g. In D1 enter, =Sumif($A$1:A$4,C1,$B$1:$B$4)

    where A1:B4 contain your original data and C1 contains the first name to sum up for...

    copy formula down.
    You had solved half of my problem, thank you very much!
    Do you know how can I obtain automatically column C without using data / filter / advanced filter / ...unique records only ?
    For input I have only column A,B and I need to obtain column C,D.

  4. #4
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    well the simple way with no formulas would be to use a pivot table, iit could then increase if other names were added.

    Or if it is just data for the 3 people to be added, make the ranges longer.

    The first answer, is exactly how I would have answered your question, so perhaps you may need to explain a little more

    Regards

    Dav

  5. #5
    Forum Contributor iscar_marius's Avatar
    Join Date
    12-19-2008
    Location
    germany
    MS-Off Ver
    2000 and 2003
    Posts
    221
    A---------B----C---------D

    john------2----john-------7
    rick-------1----rick-------1
    andrew---3----andrew----3
    john------5

    For input I have column A and B.
    For output I need column C and D
    NBVC had told me that I can use SUMIF function for column D, and it's working.
    I don't know how can I obtain column C !
    In column A I have "john" two times, with 2 and 5 elements. Rick and andrew it's only one tine each in column A.
    Thanks a lot for answering me!

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

  7. #7
    Forum Contributor iscar_marius's Avatar
    Join Date
    12-19-2008
    Location
    germany
    MS-Off Ver
    2000 and 2003
    Posts
    221
    Thanks a lot!

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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