+ Reply to Thread
Results 1 to 7 of 7

Count of adjacent values

  1. #1
    Forum Contributor
    Join Date
    07-19-2010
    Location
    Huddersfield, UK
    MS-Off Ver
    Excel 2007, 2010
    Posts
    167

    Count of adjacent values

    I am trying to create an absence planner for work, which totals up the amount of instances and days an individual is away from work based on a calendar-type table.

    I'm struggling to create the correct formula which will count the amount of instances, as in one month an individual could be off on 3 seperate occasions, but this could split out to 1 day, 5 days and 2 days, so 8 days in total). I need excel to calculate this as such. I've attached a file which I hope will demonstrate what I am trying to achieve.

    sickness file.xlsx

    Thanks in advance
    Last edited by dancing-shadow; 10-03-2014 at 03:54 AM.

  2. #2
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Count of adjacent values

    Hi,

    in AI2 and down

    =SUMPRODUCT(--(((WEEKDAY($B$1:$AE$1,2)<6)*(B2:AE2="S")+(WEEKDAY($B$1:$AE$1,2)>5)*((A2:AD2="S")+(C2:AF2="S")))&((WEEKDAY($C$1:$AF$1,2)<6)*(C2:AF2="S")+(WEEKDAY($C$1:$AF$1,2)>5)*((B2:AE2="S")+(D2:AG2="S")))="01"))


    I hope you'll receive better solutions.

    Cheers
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Contributor
    Join Date
    07-19-2010
    Location
    Huddersfield, UK
    MS-Off Ver
    Excel 2007, 2010
    Posts
    167

    Re: Count of adjacent values

    Wow that's great thank you

    I have managed to adapt it to my data, and it does work, however I totally forgot to ask for one more criteria I need...

    The dates in row 1 already run from 2012 - I need to add in a criteria to only count up these instances where the date is between today() and today()-365...

  4. #4
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Count of adjacent values

    Hi, thanks for your generous feedback but the naive formula is not meeting all expectations: I hope it could be of some ispiration.

    I don't give up.

    Cheers
    Last edited by canapone; 10-02-2014 at 02:16 PM.

  5. #5
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Count of adjacent values

    Hi,

    formula looks working: please make some tests

    Please Login or Register  to view this content.



    Regards
    Last edited by canapone; 10-03-2014 at 01:00 AM.

  6. #6
    Forum Contributor
    Join Date
    07-19-2010
    Location
    Huddersfield, UK
    MS-Off Ver
    Excel 2007, 2010
    Posts
    167

    Re: Count of adjacent values

    That is perfect! So many thanks for your time and effort, it's much appreciated!

  7. #7
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Count of adjacent values

    Hi,

    thanks for kind feedback: please test the formulas as much it's possible to insure they're accurate.

    Greetings from Firenze
    Last edited by canapone; 10-03-2014 at 04:09 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Count unique values if adjacent cell meets criteria
    By chococ in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-01-2014, 04:13 AM
  2. Replies: 3
    Last Post: 12-28-2013, 07:53 PM
  3. [SOLVED] Count values in a range if adjacent cell meets a particular criteria
    By DougC in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-22-2013, 03:12 PM
  4. count cells if ADJACENT row values meet criteria
    By xinutel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-30-2012, 03:55 PM
  5. [SOLVED] A formula to count adjacent cell values?
    By Nate Westcott in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-06-2012, 10:15 PM

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