+ Reply to Thread
Results 1 to 7 of 7

formula to count how often something AND something occur.

  1. #1
    Registered User
    Join Date
    11-30-2007
    Posts
    15

    formula to count how often something AND something occur.

    Hi,

    What i have is a table of data on one worksheet, the data consists of several columns, on another sheet i have a list of user IDs and corresponding names. What i want to do is count the number of times on the first worksheet a certain person appears in connection with a certain topic.

    example of the raw data

    1001 football
    1002 rugby
    1001 football
    1003 football
    1001 rugby
    1001 football.

    and the user table

    1001 mr smith
    1002 mrs jackson
    1003 mr white

    next to the user table i want to forexample count howmany times user ID 1001 is appears on the raw data table next to the word football.

    I hope this makes sense to somebody and I appreciate any help given.

    Cheers.

  2. #2
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    Hi,

    You can use SUMPRODUCT to do this

    Please Login or Register  to view this content.

    Alternatively you can use the cell reference in the user table in place of the number.

    Ed
    Last edited by EdMac; 02-14-2008 at 09:27 AM.

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    You mean something like this?

    =Sumproduct(--(Sheet1!A1:A100=A1),--(Sheet1!B1:B100="football"))

    Where your raw data is in Sheet1!A1:B100 and your first userID appears in A1 of the active sheet.
    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.

  4. #4
    Registered User
    Join Date
    11-30-2007
    Posts
    15
    I tried both methods, eg

    =SUMPRODUCT(--('January - NCC usage'!E2:E5000=A2)*--('January - NCC usage'!F2:F5000="xxxx"))

    However in both cases it comes up with 0 if I use the cell reference, however if i use the number 1001, it will work. Unfortunately I really need it to work with the cell reference.

    Is there anything else that i can do?

    Thanks very much for the responses so far.

  5. #5
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    Hi,

    Looks like you are mix and matching here - you formula contains components of both responses.

    Is the cell reference on the same sheet? If not you will need to include the sheet name in the reference.

    If you still get problems ZIP your file and post it here for us to look at?

    Ed

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Both ranges of userID's have to be the same format....

    Are they numbers or text entries?

    To ensure they are the same:

    Select one of those ranges and go to Data|Text to Columns and skip to the 3rd window. Select General or Text depending on what you want the format to be and click Finish. Repeat for other range of UserIDs....

    BTW, formula should be:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    11-30-2007
    Posts
    15
    Thank you so much for that, it was the format of the IDs all along!!

+ 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