Excel - Conditional Formatting Formulae

yunus786

New Member
Joined
Apr 3, 2012
Messages
20
I am using this formula in Conditional Format:
=COUNTA(D8:D21)-COUNTIF(D8:D21,"Sick")-COUNTIF(D8:D21,"Shift Change")-COUNTIF(D8:D20,"WTD")-COUNTIF(D8:D20,"Bank Holiday")-COUNTIF(D8:D20,"*Leave*")-COUNTIF(D8:D21,"OFF")-COUNTIF(D8:D21,"Not Available")-COUNTIF(D8:D21,"*LEAVE")>13
It highlights Days in red if you have worked more than 13days in a 14 day period. The problem is it highlights the first set of days in the gorup not the last set e.g. In the example below, john has worked from 4th March all the way through to the 21st March without taking a Day Off. The formula highlights the days between 4th and 9th as Days overworked. I would prefer it highlighted after the 13 consecutive day period has expired hence it should highlight from 17th to 21st as the day overworked (4th March + 12 days=13 consective days). This way it immendiately flags the day prohibited rather than scrolling back 14 days to check if it is prohibited

YunusDanJamesJohnSteveDannyIanAdamDavid
02-MarSDaysDaysNights DAYS
Days
03-MarSDaysDaysNights
DAYS
Days
04-MarMNightsDaysNightsNCSC DaysNightsWTDNightsNightsDays
05-MarT23:00 BTA Refresher courseDaysNightsNCSC DaysNightsDaysNightsNightsDays
06-MarWNightsDaysNightsDCS testing R19 NightsNightsDaysNightsNightsDays
07-MarTNightsDaysWTDDCS testing R19 NightsNightsDaysNightsNightsDays
08-MarFNightsDaysWTDDCS testing R19 NightsNightsDaysNightsNightsDays
09-MarS Days8h DCS Testing R19 nights
10-MarS Days8h DCS Testing R19 nights Nights
11-MarMNightsNightsDaysNCSC DaysNightsDaysNightsNightsNights
12-MarTNightsNightsNightsNCSC DaysNightsDaysNightsNightsNights
13-MarWNightsNightsNightsNightsNightsDaysNightsNightsNights
14-MarTNightsNightsNightsNightsNightsDaysNightsNightsNights
15-MarFNightsNightsNightsNightsNightsDaysNightsNightsNights
16-MarS NightsDaysNightsNightsNightsDaysDays
17-MarSNightsNightsNightsDaysNightsNightsNights Nights
18-MarMNightsNightsWTDNCSC DaysNightsNightsNightsLeaveNights
19-MarTNightsNightsNightsDaysNightsNightsNightsLeaveNights
20-MarWNightsNightsNightsNightsNightsNightsNightsLeaveNights
21-MarTNightsNightsNightsNightsNightsNightsNightsLeaveNights
22-MarFshift changeNightsNightsWTDWTDNightsNightsLeaveNights

<colgroup><col><col><col span="7"><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top