+ Reply to Thread
Results 1 to 14 of 14

Instances that occur in a sequence

  1. #1
    Registered User
    Join Date
    03-12-2008
    Posts
    36

    Instances that occur in a sequence

    Hi,

    I have a problem, I have a formula which counts the number of instances that occur and assigns the value as 1 for every instance, however I want the formual to also recognise that if a number of instances occur in succession a value of 1 should also be assigned.

    Is this possible?

    E.g. if a person is absent for 1 day the formula assigns a value of 1
    if a person is off for 3 days in succession the formula assigns a value of 1


    Regards

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Can you show the data setup and the current formula used?
    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-12-2008
    Posts
    36
    The sheet is used as a work schedule as well. 9 Column headings -

    Date, Shift1, Shift2 etc

    The employees initials are entered into the field according to when they are supposed to be working. The spreadsheet is updated daily, if an employee is sick, the employees intials + sick are enterd. Currently I have just used a countif formula to count the number of times every instance of (Employee Initials)+sick.

    I would say changnig the structure of the table might not be an option as I have not designed the table.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    I would like to see a sample if possible...Zipped XL spreadsheet.

  5. #5
    Registered User
    Join Date
    03-12-2008
    Posts
    36
    Sorry,

    I have attached a sample this time. Sheet 1 contains the information and sheet 2 contains my formula. In the example PY is off 4 consective days. I want this to be counted as 1. Also CM was sick 1 day, I also want this to be counted as 1. I'm trying to count the number of occasions rather than the number of days.

    Thanks
    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
    See attached....

    I added 5 helper rows (1 for each shift)... you can hide these if you wish.

    These helper rows calculate the counts of singles and groups of 3 or more "sick" for each shift. Note these are array formulas... if you edit them you have to confirm them with CTRL+SHIFT+ENTER not just ENTER so that the { } brackets appear around the formula.

    Then you just sum these up in your summary.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-12-2008
    Posts
    36
    That's brilliant NBVC,, I will try and implement that into the worksheet on Monday. Thanks for your help.

    Regards

  8. #8
    Registered User
    Join Date
    03-12-2008
    Posts
    36
    NBVC,

    thanks for your help, I'm having some problems with implementing the formula on my worksheet though. When I enter the formula and press ctrl+shift+enter a dialog saying "file not found".

    Also when check your sampe, if I change the data into original table the helper rows don't get updated.

    Do you have any ideas of why the formulas aren't working

    Regards

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    As for the formulas not updating... perhaps you have manual calculations set...

    Try going to Tools|Options and in the Calculation tab check on the Automatic calculations.

    I am not sure why you are getting "File not found". I've never seen that... are you perhaps on a Mac... I think with a Mac there is a different way of entering an array formula..I think it's Command+Return.

  10. #10
    Registered User
    Join Date
    03-12-2008
    Posts
    36
    NBVC.

    If you look at the examples. Sheets HWRC 08 + HWRC Monitoring, I think I have entered the exact same formula as the one in your sample.

    I checked tools options, it is set to automatic calculations.

    I need the formula to be able to monitoring days off, though if days are taken off in succession I want the formula to recognise this as one occurrence.

    Again, thanks for your help its really appreciated

    Regards
    Attached Files Attached Files

  11. #11
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    You did not define your Sheetname in the range reference properly... that is why you get the #NAME? error. The Single quotes are supposes to surround the whole sheet name, not part of it... and your ranges stopped at C13 when, in fact you have 371 items in your database.

    The column references need to be updated manually for each shift. You only need to do this for the first column (i.e. the PY column)... then you copy those formulas across the other columns.

    See updated sheet attached.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    03-12-2008
    Posts
    36
    NBVC,

    Thanks for all your help, that is working perfectly now.

    Regards
    Tim

  13. #13
    Registered User
    Join Date
    03-12-2008
    Posts
    36
    NBVC,

    sorry for this and I appreciate your patience. I have one last question. I created a validation list to control user entry. Would this have any effect on the formula as it doesn't seem to work with the validation list. It works perfect without the validation list however.

    Regards

  14. #14
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Can you post an example with the Validation List attempt?

+ 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