Hospital shift managing help needed-How to highlight duplicate cells in consecutive rows

alkimbeyhan

New Member
Joined
Dec 31, 2016
Messages
2
Hi, I'm trying to create our shift calendar at the hospital I'm working in and I have a problem
I'm trying to use conditional formatting to highlight duplicate cells in 3 row range.

For example;
ABCD
01/01/17JOHNKATEALICE
02/01/17REEDPETERDONALD
03/01/17RICHARDJOHNCLEMENTINE

<tbody>
</tbody>

I want B1 and C3 highlighted, because "JOHN" is repeated twice in a three day span, even though they are not necessarily in the same column
I want to know if there is a formula that can be used for this purpose
Cheers
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
On 2016 you have the option Highlight Cells Rules | Duplicate Values.

Otherwise, select A2:D4 and invoke the following formula:

=COUNTIFS($A$2:$D$4,A2)>1

then format as desired.
 
Upvote 0
Hmm...this formula seems to highlight the next cell in the next column and it highlights all the duplicates in the given range.what i want is for it to just highlight cells if they are repeated twice in three days,not if they are just duplicates. so people don't have shifts every other day and they get a chance to rest with a free day in between.
 
Upvote 0
Hmm...this formula seems to highlight the next cell in the next column and it highlights all the duplicates in the given range.what i want is for it to just highlight cells if they are repeated twice in three days,not if they are just duplicates. so people don't have shifts every other day and they get a chance to rest with a free day in between.

In E2 control+shift+enter, not just enter, and copy down:

=IF(ISNUMBER(MATCH(3,ABS($A$2:$A$4-$A2)+1,0)),1,0)

In CF invoke:

=AND(COUNTIFS($A$2:$D$4,B2)>1,$E2=1)
 
Upvote 0

Forum statistics

Threads
1,215,036
Messages
6,122,794
Members
449,095
Latest member
m_smith_solihull

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