+ Reply to Thread
Results 1 to 9 of 9

count occurences of one cell value in a range

  1. #1
    Registered User
    Join Date
    12-08-2011
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    5

    count occurences of one cell value in a range

    This is killing me:

    I have a column A with various values (x90, x91 etc.)
    I have another column B with a value of 1 sometimes attached to some of these values in column A.

    What's the formula to compute how many times one particular cell value (e.g. x90) has a value of 1 attached to it in column b?

    Thanks a million!
    Last edited by tox76; 12-10-2011 at 10:57 AM.

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

    Re: count occurences of one cell value in a range

    Try:

    =Sumproduct(--($A$2:$A$10="x90"),--($B$2:$B$10=1))

    adjust ranges and references to suit.
    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
    Registered User
    Join Date
    12-08-2011
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: count occurences of one cell value in a range

    Thanks for your reply. I can't seem to make it work, though - it returns weird values.

    I guess it would have to be a way to recognize the value inside cell A756, for instance, and match each instance of that value to the "1" value in B2:B756? I'm very confused (

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

    Re: count occurences of one cell value in a range

    Maybe you can post a small sample workbook? I am not following.

  5. #5
    Registered User
    Join Date
    12-08-2011
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: count occurences of one cell value in a range

    Yup, I can imagine I'm not putting it very clearly.

    example.jpg

    What I'd like to do is this: in column K I'd like to compute every time a title in column B (MAX81, PRO450 etc.) appears with a 1 value in the J column up to that moment. So K18, for instance, would tell me how many times MAX250 has appeared with a 1 value in the interval J2-J18.

    Needless to say, this is in fact a huge table and each value in column B appears several times throughout the worksheet.

    Thanks so much for taking the time. I'm so very lost here

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

    Re: count occurences of one cell value in a range

    Something similar:


    =Sumproduct(--($B$2:$B2="MAX250"),--($J$2:$J2=1))

    copied down.

  7. #7
    Registered User
    Join Date
    12-08-2011
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: count occurences of one cell value in a range

    Should this be working if I replace MAX250 with the cell location, like B16 or whatever? There are thousands of entries, and I'd rather the formula automatically recognized the B cell rather than I name the value...

    I tried the formula and it keeps returning weird values - it returns a 0 value in a K cell right next to a 1 in the J cell, so something's now working right

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

    Re: count occurences of one cell value in a range

    You mean?

    =Sumproduct(--($B$2:$B2=$B2),--($J$2:$J2=1))

  9. #9
    Registered User
    Join Date
    12-08-2011
    Location
    Bucharest
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: count occurences of one cell value in a range

    Yay! I did the adjustments and it works!

    Thanks so much!

+ 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