Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-05-2014, 11:47 AM
Phil H Phil H is offline Conditional Formatting Dates Windows XP Conditional Formatting Dates Office 2003
Advanced Beginner
Conditional Formatting Dates
 
Join Date: Jun 2010
Posts: 81
Phil H is on a distinguished road
Default Conditional Formatting Dates


Cell C2 has a future date in it (1/6/2015).

Range N5:N51 holds various dates. I need to conditionally format the range with a formula like =(=<C2-1097), to format the cells for dates equal to or before 1/6/2012. What would the formula be?
Reply With Quote
  #2  
Old 12-05-2014, 01:02 PM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Conditional Formatting Dates Windows 7 64bit Conditional Formatting Dates Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,779
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Hi
select N5:N51 and use
Code:
=$N5=<date(year($c$2-3),month($c$2),day($c$2))
as CF then format as required
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #3  
Old 12-08-2014, 05:22 AM
Phil H Phil H is offline Conditional Formatting Dates Windows XP Conditional Formatting Dates Office 2003
Advanced Beginner
Conditional Formatting Dates
 
Join Date: Jun 2010
Posts: 81
Phil H is on a distinguished road
Default

Hi Pecoflyer, Thanks for your reply. I copied the formula into CF rules, formatted, and got: "The formula you typed contains an error......" I also tried it on a single cell, with the same result. Any idea what I could be doing wrong?
Reply With Quote
  #4  
Old 12-08-2014, 05:57 AM
Phil H Phil H is offline Conditional Formatting Dates Windows XP Conditional Formatting Dates Office 2003
Advanced Beginner
Conditional Formatting Dates
 
Join Date: Jun 2010
Posts: 81
Phil H is on a distinguished road
Default

Pecoflyer, Got rid of the error with: =$N5<=DATE(YEAR($C$2-3),MONTH($C$2),DAY($C$2)), but now all dates are coming up formatted - the formula is saying every date is TRUE, which is incorrect.
Reply With Quote
  #5  
Old 12-08-2014, 06:06 AM
Phil H Phil H is offline Conditional Formatting Dates Windows XP Conditional Formatting Dates Office 2003
Advanced Beginner
Conditional Formatting Dates
 
Join Date: Jun 2010
Posts: 81
Phil H is on a distinguished road
Default

SOLUTION: =$N5<=DATE(YEAR($C$2-3),MONTH($C$2),DAY($C$2)). The "-3" is interpreted as days in the YEAR expression. If "-3" is replaced with "1097", the formula works.
Reply With Quote
  #6  
Old 12-08-2014, 06:30 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Conditional Formatting Dates Windows 7 64bit Conditional Formatting Dates Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,779
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Typo of mine it shoud be YEAR($C$2)-3 . Sorry about the mistake
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #7  
Old 12-08-2014, 07:42 AM
Phil H Phil H is offline Conditional Formatting Dates Windows XP Conditional Formatting Dates Office 2003
Advanced Beginner
Conditional Formatting Dates
 
Join Date: Jun 2010
Posts: 81
Phil H is on a distinguished road
Default

Not a problem. Thanks for the help.
Reply With Quote
Reply

Tags
conditional formatting



Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Formatting/If Statement with Dates AndrewEnos Excel 2 07-22-2014 07:34 AM
Conditional Formatting - color only dates contained in a range EC37 Excel 1 07-08-2014 12:51 PM
Conditional Formatting - past due dates namedujour Excel 1 06-27-2014 04:16 PM
Conditional Formatting with Dates namedujour Excel 1 02-21-2013 03:42 AM
Conditional Formatting Expiration Dates Based on Text in Adjacent Cell Frogggg Excel 1 10-25-2011 08:44 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:56 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft