+ Reply to Thread
Results 1 to 2 of 2

Conditional Formatting: One date between two other dates

  1. #1
    Registered User
    Join Date
    11-27-2013
    Location
    Missouri
    MS-Off Ver
    Excel 2010
    Posts
    13

    Conditional Formatting: One date between two other dates

    Good afternoon!
    I'm trying to develop a formula that will help me distinguish if a certain date is related to a date range. For clarification: I have a diagnostic test date that I need to "associate" to antibiotic start dates.

    Excel_Format_upload.JPG

    I need the D column to look and determine if the antibiotic was started 24 hours before or 24 hours after diagnostic testing date. All of my dates are in date/time format NOT text. Hopefully that makes sense...

    Thanks for your help in advance!!

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,937

    Re: Conditional Formatting: One date between two other dates

    For your table as shown, entered in cells A1:D5. In D2, enter the formula

    =AND(B2>A2-1,B2<A2+1)

    If you want to use it as a CF formula, select columns A:C, format for the 'bad' format, and use this formula to apply the 'good' format with CF.

    =AND($B2>$A2-1,$B2<$A2+1)
    Last edited by Bernie Deitrick; 10-04-2018 at 03:40 PM.
    Bernie Deitrick
    Excel MVP 2000-2010

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Conditional Formatting Date based on a Named Range set of Dates
    By coreytroy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-07-2018, 02:46 AM
  2. [SOLVED] Conditional formatting dates based on date range and day - pt2
    By dancing-shadow in forum Excel General
    Replies: 5
    Last Post: 01-13-2014, 07:12 AM
  3. [SOLVED] Conditional formatting dates based on date range and day
    By dancing-shadow in forum Excel General
    Replies: 4
    Last Post: 01-07-2014, 01:45 PM
  4. Conditional Formatting (or a formula) For Dates Comparing to the Current Date
    By shoebox54th in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-08-2013, 01:20 PM
  5. Conditional Formatting Cells with Dates Outside of Date Range
    By emalegria in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-18-2013, 04:09 PM
  6. Replies: 2
    Last Post: 12-18-2012, 11:18 AM
  7. Replies: 2
    Last Post: 09-20-2011, 04:45 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1