Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Formula to count occurences of sickness

Hi all,

Hope you can help - I have limited excel knowledge and I'm stumped with a request from my boss:

I have a stsff sickness/leave monitor spreadsheet.

It has a summary worksheet, and 12 monthly sheets.
On each monthly sheet I have staff names listed in column B (B4 to B40), with dates in row 3 (Example January runs from C3 to AF3). In each row I currently enter a 1 for a full day holiday, 0.5 for half a day holiday and "S" for a days sickness. Sums for holidays and sickness are shown in the summary sheet.

I need to show my boss occurences of sickness for each member of staff (so if someone has a day off during the week, then another the following week - that ciounts as two. If someone has a friday off, then a monday - that counts as one).

I hope this makes sense!


Submitted via EggHeadCafe - Software Developer Portal of Choice
Command Prompt Here with VS.NET Environment
http://www.eggheadcafe.com/tutorials...here-with.aspx
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default Formula to count occurences of sickness

For formula-specific questions, consider posting to
microsoft.public.Excel.Worksheetfunctions

If I were setting this up from scratch, I would put in an 's' for the first
day of any sick leave (marking the instance), and each subsequent day with a
different letter showing that the leave extended across multiple days. That
would make the formulas even easier. However,

For each row, what you are really worried about is how many cells have a
value of "s" where the preceeding cell was /not/ "s"

for your first employee in row 4: find a cell and enter:
=SUMPRODUCT((C3:AF3="s")*1,(B3:AE3<"s")*1)

Or paste this into the "Jan" cell in your summary worksheet for this
employee, then select the cell references (e.g. C3:AF3) and then go select
the same range on your Jan spreadsheet so that it gets the full page
reference.

This should give you your count of sick occurences. Note that this formula
cannot be entered in the range of B3:AF3 because that would create a circular
reference.

Important note: this will NOT guarantee an accurate count, due to the
workbook design. If you have an employee who is sick on Jan 31 and that
sickness lasts two days, this method will show a new instance on Feb 1
because the months are broken out across worksheets. Suggested fix: Add a new
column in C3 of each monthly worksheet. Set that cell value equal to the last
day of the month on the previous month's spreadsheet (e.g. the Jan 31 "s"
will now also show in C3 of the Feb sheet, and the Feb data will be in
D3:AG3). Adjust the formula above by moving both ranges to the right one cell:

=SUMPRODUCT((D3:AG3="s")*1,(C3:AF3<"s")*1)

and that should give you an accurate count of sick instances, including
those that bridge across months.

HTH,
Keith


"David Kenney" wrote:

Hi all,

Hope you can help - I have limited excel knowledge and I'm stumped with a request from my boss:

I have a stsff sickness/leave monitor spreadsheet.

It has a summary worksheet, and 12 monthly sheets.
On each monthly sheet I have staff names listed in column B (B4 to B40), with dates in row 3 (Example January runs from C3 to AF3). In each row I currently enter a 1 for a full day holiday, 0.5 for half a day holiday and "S" for a days sickness. Sums for holidays and sickness are shown in the summary sheet.

I need to show my boss occurences of sickness for each member of staff (so if someone has a day off during the week, then another the following week - that ciounts as two. If someone has a friday off, then a monday - that counts as one).

I hope this makes sense!


Submitted via EggHeadCafe - Software Developer Portal of Choice
Command Prompt Here with VS.NET Environment
http://www.eggheadcafe.com/tutorials...here-with.aspx
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to count occurences of word in spreadsheet formula JBW Excel Worksheet Functions 10 October 30th 07 06:51 PM
Creating number formula to count number occurences in a data set Brreese24 Excel Programming 1 August 23rd 07 11:18 PM
Count Occurences Lmurraz Excel Discussion (Misc queries) 3 July 11th 07 02:46 PM
Count # of Occurences Sweepea Excel Discussion (Misc queries) 6 December 14th 06 02:27 AM
Count occurences AvalancheMike Excel Programming 4 January 24th 05 11:07 PM


All times are GMT +1. The time now is 01:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"