+ Reply to Thread
Results 1 to 9 of 9

find how many times a value is in range B3:D12

  1. #1
    Registered User
    Join Date
    03-04-2008
    Posts
    14

    find how many times a value is in range B3:D12

    What i want to do is:
    1. To find a value in B3:D12
    2. Count how many times that value is written
    3. Give me the number

    Anyone know what kind of formula i must use? VLOOKUP maybe?

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

    e.g. =Countif(B3:D12,1) counts how many 1's in the range

    See Excel help on this function
    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
    03-04-2008
    Posts
    14
    It worked at first, but not when I wanted to:

    If the E column don't has a value, e.g. E3 = "", it will skip the row from the counting.

    I tried this formula:
    =IF(E3="";"";COUNTIF(B3:D3;J3))+IF(E4="";"";COUNTIF(B4:D4;J3))+IF(E5="";"";COUNTIF(B5:D5;J3))+IF(E6="";"";COUNTIF(B6:D6;J3))+IF(E7="";"";COUNTIF(B7:D7;J3))+IF(E8="";"";COUNTIF(B8:D8;J3))+IF(E9="";"";COUNTIF(B9:D9;J3))+IF(E10="";"";COUNTIF(B10:D10;J3))+IF(E11="";"";COUNTIF(B11:D11;J3))+IF(E12="";"";COUNTIF(B12:D12;J3))

    It worked at first when the E column had a value on all rows, but when it didnt have a value, I get an error message: #value!

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    So you tried =Countif(B3:D12,J3) ?

    What kind of data is in B3:D12 and what is in J3?

  5. #5
    Registered User
    Join Date
    03-04-2008
    Posts
    14
    I've uploaded the worksheet.
    Attached Files Attached Files

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    If you are copying the formula down, then you will need to "freeze" the range...

    Try: =COUNTIF($B$3:$D$12,J3) copied down.

  7. #7
    Registered User
    Join Date
    03-04-2008
    Posts
    14
    Yeah, I know. But the problem occur if a match isn't played yet.


    e.g. If Team E and Team B haven't played yet, the cells E12 and G12 will be blank. But when i "blank" it, K3 gives me the error #VALUE! Copying the formula isn't the problem.


    What i want the formula to do, is that if a match haven't been played yet, it will not count it in the match's played column.


    Do you understand the problem?

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

    Then perhaps try:

    =SUMPRODUCT(($B$3:$D$12=J3)*($E$3:$E$12<>""))

    copied down.

  9. #9
    Registered User
    Join Date
    03-04-2008
    Posts
    14
    Thanks, that worked fine =)

+ 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