conditional formatting help!

excelhelpmepls

New Member
Joined
Feb 16, 2022
Messages
3
Office Version
  1. 365
Platform
  1. Windows
in column H I have dates when someone tested positive for covid and in column I I have dates when we collected blood samples from those patients. I need to highlight the dates in column I that are 5 days before the positive test in cloumn H or 5 days after the positive test date in column H.

I tried to conditionally format using a the following formula:
=($H:$H+5)>$I:$I>($H:$H-5)

but no cells were highlighted...is there something I am doing wrong? I made sure all cells were formatted as dates in the same way.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Not 100% clear on what you want.

This highlights all blood tests that are more than 5 days before the test result or more than 5 days after the test result.
MrExcelPlayground7.xlsx
HI
1CovidBloodtest
21/3/20221/5/2022
31/5/20221/3/2022
41/8/20221/2/2022
51/11/20221/17/2022
Sheet2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I2:I5Expression=ABS(I2-H2)>5textNO
 
Upvote 0
@gordsky @JamesCanale thanks for your responses! I want to highlight dates in column I that fall between 5 days before the postive test and 5 days after the test. So any date within those 10 days should be highlighted
 
Upvote 0
This then:
MrExcelPlayground7.xlsx
HI
1CovidBloodtest
21/3/20221/5/2022
31/5/20221/3/2022
41/8/20221/2/2022
51/11/20221/17/2022
Sheet2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I2:I5Expression=ABS(I2-H2)<=5textNO
 
Upvote 0
my original code will do that
I think this is only highlighting cells with dates that are either exactly 5 days before or after. Is there a way to highlight any date that is within 5 days before or 5 days after the covid+ test?
 
Upvote 0
I think this is only highlighting cells with dates that are either exactly 5 days before or after. Is there a way to highlight any date that is within 5 days before or 5 days after the covid+ test?
yes it will as that was your request in post#1. If you want a formula to highlight something between the two ranges of 5 days either side then try this

Excel Formula:
=AND(I1<>"",I1<H1+5,I1>H1-5)
 
Upvote 0

Forum statistics

Threads
1,214,813
Messages
6,121,706
Members
449,048
Latest member
81jamesacct

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