ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Conditionally Format Particular Dates (https://www.excelbanter.com/excel-worksheet-functions/427005-conditionally-format-particular-dates.html)

robzrob

Conditionally Format Particular Dates
 
Can't seem to work this one out.

Col A has dates in it. If today is either a Friday, Saturday or
Sunday, and the date in A is more than 1 yr before the coming Sunday's
date (or today's date if today is Sunday) conditionally format (turn
red, underline, whatever) A. If today is any other day and the date
in A is more than 1 yr before today, conditionally format (turn
red...etc) A.

I hope I've explained that clearly.

(Need it to work for leap years as well as ordinary years.)

Regards

Jim Cone[_2_]

Conditionally Format Particular Dates
 
Give this a try...
=OR(AND(WEEKDAY(TODAY(),2)<5,YEARFRAC(TODAY(),A1,1 )1),AND(WEEKDAY(TODAY(),2)4,YEARFRAC(TODAY()+7-WEEKDAY(TODAY(),2),A1,1)1))
'---
Depending on xl version, requires loading analysis tool pak

--
Jim Cone
Portland, Oregon USA .
http://www.contextures.com/excel-sort-addin.html .
editorial review of special sort excel add-in (30 ways to sort)






"robzrob"
wrote in message
...
Can't seem to work this one out.

Col A has dates in it. If today is either a Friday, Saturday or
Sunday, and the date in A is more than 1 yr before the coming Sunday's
date (or today's date if today is Sunday) conditionally format (turn
red, underline, whatever) A. If today is any other day and the date
in A is more than 1 yr before today, conditionally format (turn
red...etc) A.

I hope I've explained that clearly.

(Need it to work for leap years as well as ordinary years.)

Regards





All times are GMT +1. The time now is 09:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com