I am looking for help to create a conditional format formula.
The attached file shows what I am trying to do.
Kerry
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Conditional Formatting (Excel 97)
Highlight Cells K5:O50 (extend the column number and rows as desired to expand the range)
Format -conditional formatting..
Select: “Formula is” in left combobox
Add to right box (No quotes)”
“=AND(MONTH($G5)=MONTH(K$2),NOT(ISBLANK($G5)),NOT(ISBLANK(K$2)))”
Patteren tab
Select gray shading
The formula looks for a match, but also makes sure that G is not blank (Month = 1 for “blank”) as well as nothing in ROw 2.
Steve
You set it as condition 3. Conditons are NOT cumulative. SInce the 1st condition is met, that formatting takes place (no matter what the other conditions have).
If Condition 1 is false then condition 2 is examined If TRUE that formatting is active.
IF BOTH condition 1 NAD condition 2 is false then condition 3 is checked.
You can ONLY have 4 formats:
Format 1 (Std format via format cells when NO conditions are true)
Format 2 when CONDITION 1 is TRUE
Format 3 when CONDITION 1 is FALSE and Condition 2 is TRUE
Format 4 when CONDITION 1 is FALSE and Condition 2 is FALSE and condition3 is TRUE
If you want shaded for date AND Green based on col I you would have to AND the 2 conditions:
=AND($i4<k4,MONTH($G4)=MONTH(K$2),NOT(ISBLANK($G4)),NOT(ISBLANK(K$2)))
Then you would need another for shaded and ORANGE (when K is NOT larger than I)
=AND($i4<k4,MONTH($G4)=MONTH(K$2),NOT(ISBLANK($G4)),NOT(ISBLANK(K$2)))
Then for the third (green no shading)
=$i4<k4
For orange with no shading you would have to set the format of the cells directly (format -cells)
If you need MORE than 4 formats with 3 conditions, you will have to have a macro do it (which could slow things down considerably to keep it live and always up-to-date, since the macro would have to run on every worksheet change and reformat EVERYTHING.
Steve
You set it as condition 3. Conditons are NOT cumulative. SInce the 1st condition is met, that formatting takes place (no matter what the other conditions have).
If Condition 1 is false then condition 2 is examined If TRUE that formatting is active.
IF BOTH condition 1 NAD condition 2 is false then condition 3 is checked.
You can ONLY have 4 formats:
Format 1 (Std format via format cells when NO conditions are true)
Format 2 when CONDITION 1 is TRUE
Format 3 when CONDITION 1 is FALSE and Condition 2 is TRUE
Format 4 when CONDITION 1 is FALSE and Condition 2 is FALSE and condition3 is TRUE
If you want shaded for date AND Green based on col I you would have to AND the 2 conditions:
=AND($i4<k4,MONTH($G4)=MONTH(K$2),NOT(ISBLANK($G4)),NOT(ISBLANK(K$2)))
Then you would need another for shaded and ORANGE (when K is NOT larger than I)
=AND($i4<k4,MONTH($G4)=MONTH(K$2),NOT(ISBLANK($G4)),NOT(ISBLANK(K$2)))
Then for the third (green no shading)
=$i4<k4
For orange with no shading you would have to set the format of the cells directly (format -cells)
If you need MORE than 4 formats with 3 conditions, you will have to have a macro do it (which could slow things down considerably to keep it live and always up-to-date, since the macro would have to run on every worksheet change and reformat EVERYTHING.
Steve
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.
Notifications