Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-05-2023, 01:52 PM
whsnow whsnow is offline Conditional Formatting based on values in two cells Windows 10 Conditional Formatting based on values in two cells Office 2010 64bit
Novice
Conditional Formatting based on values in two cells
 
Join Date: Mar 2018
Posts: 7
whsnow is on a distinguished road
Default Conditional Formatting based on values in two cells

Hi,
I have written formulas to add fill to cells based on distance out from a future date (i.e. at >90 days, 90-61, 60-31, and 30-0 days out from future date fill green, yellow, orange, or red). (See image)

This works fine, but I'd like to add to the formula so that if a cell on the same row in a different column has any date entered into it, no conditional formatting is applied. Said another way, if my conditional formatting is in E2, and any date is entered in G2, it would override the conditional formatting and no color is applied.

Also, Excel defaulted to including an AND statement in the 2nd, 3rd, and 4th condition. I guess I'm just not clear why that's appropriate since the conditions are all independent of each other and cannot exist at the same time, though I understand why the OR statement is also not appropriate.



Thanks,
Henry
Attached Images
File Type: png ConditionalFormatting.png (19.9 KB, 14 views)
Reply With Quote
  #2  
Old 07-05-2023, 11:45 PM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Conditional Formatting based on values in two cells Windows 10 Conditional Formatting based on values in two cells Office 2021
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
to start with you should replace E2 in your CF with $E2
Your formula for green should be =($E2-today())>90
The others can just boil down to
=($E2-today())>=61
=($E2-today())>=31
=($E2-today())>=0
As for including the condition in col G you did not specify what it MIGHT contain except a date
Supposing the cells in G contain a date or are empty, try adding a condition to all of your previously defined CF's, like
=AND($G2="",($E2-today())>90)
etc..
__________________
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 07-09-2023, 02:50 AM
p45cal's Avatar
p45cal p45cal is offline Conditional Formatting based on values in two cells Windows 10 Conditional Formatting based on values in two cells Office 2021
Expert
 
Join Date: Apr 2014
Posts: 871
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

Quote:
Originally Posted by whsnow View Post
a different column has any date entered into it
It's difficult for Excel to determine if a date is in a cell because Excel stores dates as numbers but the format of the cell is a date format of some kind. What's more, if someone enters a date like 24th Dec 23, Excel won't necessarily recognise it as a date even though it's obviously a date to us humans. It is possible but it's convoluted and still not a certainty that it'll get it right.
So to avoid all that, would it do if either the cell wasn't blank, or perhaps was a number in order to decide whether the conditional formatting showed or not? It would just be a matter of adding a 3rd argument to the AND part of the conditional formatting formula.
Reply With Quote
Reply

Tags
conditional formatting, dates, multiple values



Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Formatting on cell values outside of a designated range based on category denoted in key interntime Excel 3 05-21-2018 10:15 PM
Conditional formatting to color cells based on number kallard Excel 4 12-26-2016 11:10 AM
Conditional formating all cells in an array based on adjacent cells deejay Excel 6 12-20-2016 12:00 PM
Conditional Formatting Multiple Or Values Phil H Excel 4 05-21-2015 04:16 AM
Conditional Formatting for values with more than 2 decimals lynchbro Excel 6 04-17-2015 06:05 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:58 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