View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier
 
Posts: n/a
Default counting consecutive absences

Hi Jerry

You could do this with Conditional Formatting
Assuming your data starts in B2, then the earliest value that could have
three consecutive "A"'s is D2.
Also assuming you have 100 rows with data
Highlight D2:BB101
FormatConditional Formattinguse dropdown to select Formual is and in
the whit epane type
=SUMPRODUCT(--(B2:D2="A"))=3
Choose Format and select either a coloured Font or Red or Background of
Red
Click the Add button and repeat the above but set the last part of
formula =2, and a format of Yellow
Click Add button, change last part of formula to =1 and set Format to
Green


--
Regards

Roger Govier



jerry37917 wrote:
I have a worksheet that lists all the members of our church. Across
the top are all the Sundays in the year. Next to each person's name,
I am filling the sheet with either an A (Absent) or P (present). To
the far left, I have a column called "number of consecutive
absences". What I need is a formula to count the number of
consecutive absences from the most reason Sunday. Something like this:

John Smith A P A A P A A A
3

In the example John has missed three consecutive Sundays. If he is
present at the next meeting, the number would reset to 0. If he is
absent, it would then be 4. I don't need to count the total number
of absences, just the number of absences since the last attendance.

The purpose is to help our outreach teams keep in contact. When a
person is absent, we want to send a card, but when a person is absent
twice in a row we want to make a call...three times...a visit...and
so on. This worksheet will make it a lot easier to keep track of
what the teams should be doing.

Thanks in advance for your help.

Jerry