Consulting

Results 1 to 4 of 4

Thread: Help needed with counting formula

  1. #1
    VBAX Regular
    Joined
    May 2004
    Location
    UK
    Posts
    71
    Location

    Help needed with counting formula

    I need to input a formula that counts how many times a certain number occures in a column.
    The formula that i have got at the moment is: =COUNTIF(E:E,10) That works fine but there are some cells that i do not want it to count, there are people who are on holiday and sick i do not want it to count those occurances, i have tried the following but what this does is it just counts the occurances of hol not how many people who are on 10 hour shifts that are on hol

    =COUNTIF(E:E,10)-COUNTIF(F:F,"hol")-COUNTIF(F:F,"sick")
    I need it to count just the 10 and i also have another formula that does the same but for 8

    Regards

    Ian
    One Day Soon I will Be able to Answer a question On Here, But until that day I have to rely on All the other coders to give me the answers.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Hi Ian,

    If you want to count the items in column E that equal 10, and where the corresponding item in F is not hol or sick, use

    =SUMPRODUCT(--(E1:E1000=10),--((F1:F1000<>"sick")*(F1:F1000<>"hol")))
    obviously you can replace the =10 with = cell_ref when 10 is in cell_ref
    ____________________________________________
    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

  3. #3
    VBAX Regular
    Joined
    May 2004
    Location
    UK
    Posts
    71
    Location
    Thank you for the quick reply XLD, I will try that later as i am just going out, I will let you know how I get on


    Regards

    Ian
    One Day Soon I will Be able to Answer a question On Here, But until that day I have to rely on All the other coders to give me the answers.

  4. #4
    VBAX Regular
    Joined
    May 2004
    Location
    UK
    Posts
    71
    Location
    Thank you XLD, I have now tried that and it works great so i will mark this as solved.


    Regards

    Ian
    One Day Soon I will Be able to Answer a question On Here, But until that day I have to rely on All the other coders to give me the answers.

Posting Permissions

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