Over riding conditional formatting?

Ian1976

Board Regular
Joined
Feb 4, 2016
Messages
137
Office Version
  1. 365
Platform
  1. Windows
Hi,
Not sure if what I'm trying to achieve is possible?

I have a number between 0 and 10000 in cell B10 that has the following conditional formatting - "Cell Value Between 1000 and -500" & "Cell Value Between 6000 and 4500" which will turn the number in B10 Red

I have a date in cell C10 which if it is within 4 days of todays date (which is also available in cell P1) then I'd like it to ignore the conditional formatting formula?

Is that possible?

Thanks :)
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
you can setup a new rule

using an AND(

so this will test if the date is less than 4 days from today - and so only true if thats correct
C10 < today()+4

OR(
AND (B10 > = 500 , B10 < = 1000)
AND (B10 > = 4500 , B10 < = 6000))

so add those together

=AND(C10<TODAY()+4,OR(AND(B10>500,B10<1000),AND(B10>4500,B10<6000)))
should be the formula you need

for 2007, 2010 , 2013 , 2016 , 2019 or 365 Subscription excel version
Conditional Formatting

Highlight applicable range >>
B10 - Change, reduce or extend the rows to meet your data range of rows

Home Tab >> Styles >> Conditional Formatting
New Rule >> Use a formula to determine which cells to format
Edit the Rule Description: Format values where this formula is true:
=AND(C10<TODAY()+4,OR(AND(B10>500,B10<1000),AND(B10>4500,B10<6000)))

Format [Number, Font, Border, Fill] - choose format needed
choose the format you would like to apply when the condition is true
OK >> OK


A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Upvote 0
Thanks, just trying to upload an example... Excel(Not responding) :)
 
Upvote 0
ok, for some reason, my formula has changed

=AND(C10>TODAY()+4,OR(AND(B10>=500,B10<=1000),AND(B10>=4500,B10<=6000)))

so C10 has to be later than today() + 4 days
and i have included = in the number ranges

not sure why that changed ... i must have edited

I have added the xl2bb here
so you can copy into excel and test


Book4
ABC
1
2
3
4
5
6
7
8
9
1010004/25/23
Sheet1
Cell Formulas
RangeFormula
C10C10=TODAY()+12
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B10Expression=AND(C10>TODAY()+4,OR(AND(B10>=500,B10<=1000),AND(B10>=4500,B10<=6000)))textNO
 
Upvote 0
Hopefully this has worked?

Book1
ABCDEKLMNOPQ
113/04/2023
2
3
4
5
6
7
8
10465801-Mar-239658
12165830-Mar-236658
13408501-Apr-234085
14116027-Mar-231160
1614829-Mar-23148
17325202-Apr-233252
18410909-Apr-239109
19296629-Mar-237966
21282701-Apr-237827
22
23
24
26Column D is a Vlookup formaul result from anther sheet within this workbook The cells in column B are required to be red if "Cell Value Between 1000 and -500" & "Cell Value Between 6000 and 4500" But if date in column C is within 4 days of cell P1 then ignore formatting and leave as standard.
27
28
30
31
32
33
35
Sheet1
Cell Formulas
RangeFormula
P1P1=Sheet2!P1
B10,B12:B14,B16:B19,B21B10=IF(D10>5000,D10-5000,D10)
 
Upvote 0
ok , thats helpful

we dont have P1 - whats that date ??? is it today

and the cell value

so between 1000 and is that minus -500
you original post said number between 0 and 10000
I have a number between 0 and 10000 in cell B10

within 4 days - today is the 13th April
so anything upto and including the 17th April - should not colour - only dates greater than 4 days - so greater than the 17th April

BUT what about earlier dates - so is that also within 4 days
so 9th April to 17th April ... inclusive - does not colour all other dates do colour if the numbers are within the rules

in which case , all your examples would highlight just because of the date - NOT the number, ignoring that - at moment , just need to understand the dates ???
except row 18 which is the 9th April
 
Upvote 0
ok , thats helpful

we dont have P1 - whats that date ??? is it today

and the cell value

so between 1000 and is that minus -500
you original post said number between 0 and 10000


within 4 days - today is the 13th April
so anything upto and including the 17th April - should not colour - only dates greater than 4 days - so greater than the 17th April

BUT what about earlier dates - so is that also within 4 days
so 9th April to 17th April ... inclusive - does not colour all other dates do colour if the numbers are within the rules

in which case , all your examples would highlight just because of the date - NOT the number, ignoring that - at moment , just need to understand the dates ???
except row 18 which is the 9th April
Hi,

Sorry I'm terrible at explaining things! As there are multiple sheets in the workbook the date is entered once manually into P1 and then P1 on several other sheets reference that first one.
Cell value is just 13/04/23 formatted as Date

Regarding the cell value the number in column B will be from -500 to 10000, but needs highlighting if its between 1000 and minus 500 (-500) or between 4500 and 6000

With the dates, if the date is 4 days or more earlier than the current date then the rules for highlighting are required to be active, if its less then do nothing, if that makes sense?

So if cell P1 was showing todays date, and a date in column C was the 09/04/23, 10/04/23, 11/04/23 or 12/04/23 then no formatting would be required if it was older than that then the formatting would be required.

Thanks for looking, appreciate your time! :)
 
Upvote 0
do you need to compare to P1 or will it always be todays date
in which case we can use today() and not worry about P1

also
what happens if the date is tomorrow - so today() is 13 april - if the date is the future - what to do ?

i have used

=AND(B10<>"",C10<=TODAY()-4,OR(AND(B10>=-500,B10<=1000),AND(B10>=4500,B10<=6000)))



Book4
ABCDEFGHIJKLM
1
2
3
4
5
6
7
8range of numbers
9
1046581-Mar-239658TRUETRUE
11FALSEFALSE
12165830-Mar-236658FALSEFALSE
1340851-Apr-234085FALSEFALSE
14116027-Mar-231160FALSEFALSE
15FALSEFALSE
1614829-Mar-23148TRUETRUE
1732522-Apr-233252FALSEFALSE
1841099-Apr-239109FALSEFALSE
19296629-Mar-237966FALSEFALSE
20FALSEFALSE
2128271-Apr-237827FALSEFALSE
22-30013-Apr-23FALSE
23-2998-Apr-23TRUE
24
25
26Column D is a Vlookup formaul result from anther sheet within this workbook The cells in column B are required to be red if "Cell Value Between 1000 and -500" & "Cell Value Between 6000 and 4500" But if date in column C is within 4 days of cell P1 then ignore formatting and leave as standard.
27
28
29
30
31
32
33
Sheet2
Cell Formulas
RangeFormula
B10,B21,B16:B19,B12:B14B10=IF(D10>5000,D10-5000,D10)
H10:H21H10=AND(B10<>"",OR(AND(B10>=-500,B10<=1000),AND(B10>=4500,B10<=6000)))
C22C22=TODAY()
C23C23=TODAY()-5
F10:F23F10=AND(B10<>"",C10<=TODAY()-4,OR(AND(B10>=-500,B10<=1000),AND(B10>=4500,B10<=6000)))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D10:D23Expression=AND(B10<>"",C10<=TODAY()-4,OR(AND(B10>=-500,B10<=1000),AND(B10>=4500,B10<=6000)))textNO
 
Upvote 0
Solution
the date should always be the current date so today() should be ok! (y)
 
Upvote 0
ok, see the example i updated

maybe you could also add some examples and colour manually - just to be sure its doing what you want - I had to add a couple more examples to the sheet
 
Upvote 0

Forum statistics

Threads
1,215,039
Messages
6,122,799
Members
449,095
Latest member
m_smith_solihull

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