SOLVED
Home

Conditional Formatting using multiple conditions

%3CLINGO-SUB%20id%3D%22lingo-sub-734689%22%20slang%3D%22en-US%22%3EConditional%20Formatting%20using%20multiple%20conditions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-734689%22%20slang%3D%22en-US%22%3E%3CP%20class%3D%22contentStandard%20x-hidden-focus%22%3EHello%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22contentStandard%22%3EI%20was%20wondering%20if%20someone%20could%20help%20me.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22contentStandard%22%3EI%20work%20in%20training%20within%20law%20enforcement%20and%20have%20made%20a%20spreadsheet%20to%20help%20me%20keep%20track%20of%20what%20hours%20the%20officers%20work%20each%20year%20to%20stay%20proficient.%20The%20hours%20are%20broken%20down%20into%20modules%20(A1.1%2C%20A1.2%2C%20A2.1%20etc)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22contentStandard%22%3EEvery%20four%20weeks%20a%20team%20attends%20training%20and%20each%20day%20a%20lesson%20will%20be%20covered%20which%20will%20contain%20a%20number%20of%20hours%20of%20each%20type%20of%20module.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22contentStandard%22%3EThe%20spreadsheet%20has%20a%20list%20of%20the%20lessons%20and%20when%20an%20officer%20attends%20the%20lesson%20he%20will%20be%20marked%20as%20%E2%80%9Cattended%E2%80%9D%2C%20this%20will%20then%20credit%20the%20officer%20with%20the%20appropriate%20amount%20of%20hours%20for%20each%20module%20contained%20within%20that%20lesson.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22contentStandard%22%3EFor%20example%2C%20Lesson%20A%20contains%201%20hour%20module%20A1.1%2C%202%20hours%20module%20A1.2%20and%201%20hour%20A2.1.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22contentStandard%22%3EThis%20will%20then%20add%20these%20hours%20to%20his%20scoresheet%2C%20by%20the%20end%20of%20the%20year%20the%20officer%20must%20have%20hit%20a%20certain%20number%20of%20hours%20on%20each%20module%20to%20stay%20proficient.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20class%3D%22contentStandard%22%3EEach%20training%20cycle%20I%20also%20have%20an%20officer%20benchmark%2C%20which%20says%20that%20if%20the%20officer%20has%20hit%20every%20available%20lesson%20that%20has%20been%20provided%20he%20will%20to%20date%20have%20accrued%20this%20many%20hours.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ffilestore.community.support.microsoft.com%2Fapi%2Fimages%2Fd18651cd-0f22-4c3e-ae85-dbf944cf6e47%3Fupload%3Dtrue%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ffilestore.community.support.microsoft.com%2Fapi%2Fimages%2Fd18651cd-0f22-4c3e-ae85-dbf944cf6e47%3Fupload%3Dtrue%22%20border%3D%220%22%20alt%3D%22Image%22%20%2F%3E%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20the%20spreadsheet%20currently%20stands%2C%20if%20the%20officer%20has%20hit%20the%20%22benchmark%22%20hours%20then%20his%20number%20for%20that%20particular%20module%20then%20the%20number%20will%20turn%20green.%20If%20the%20Officer%20has%20not%20attended%20the%20amount%20of%20lessons%20that%20have%20been%20provided%20then%20the%20number%20will%20turn%20red.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%20for%20some%20of%20the%20modules%2C%20the%20officer%20only%20has%20to%20accrue%201%20hour%20for%20the%20year%20but%20the%20number%20of%20times%20that%20it%20will%20be%20hit%20in%20lessons%20will%20be%20more%20than%20that%20(see%20I5).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20i'd%20like%20to%20be%20able%20to%20do%20is%20this....%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20the%20number%20is%20higher%20than%20the%20%22Total%20Required%22%20then%20turn%20the%20text%20green.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20the%20number%20is%20equal%20to%20the%20%22Benchmark%22%20but%20less%20than%20the%20%22Total%20Required%22%20then%20turn%20the%20text%20amber.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20the%20number%20is%20less%20than%20both%20the%20%22Benchmark%22%20and%20%22Total%20Required%22%20then%20turn%20the%20text%20red.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20not%20great%20with%20Excel%20and%20hope%20someone%20can%20help%20me%20with%20this.%20I'm%20sure%20it's%20probably%20a%20simple%20answer%20but%20any%20help%20would%20be%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMany%20thanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERob%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-734689%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%20on%20Mac%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-735293%22%20slang%3D%22en-US%22%3ERe%3A%20Conditional%20Formatting%20using%20multiple%20conditions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-735293%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F270033%22%20target%3D%22_blank%22%3E%40d32bus%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20need%20three%20conditional%20formatting%20rules%2C%20one%20for%20each%20color.%20Select%20your%20entire%20range%20(e.g.%20E5%3AL11%20as%20on%20picture)%20and%20add%20new%20rule%20using%20the%20formula.%20For%20green%20it'll%20be%3C%2FP%3E%0A%3CPRE%3E%3DE5%26gt%3BE%243%3C%2FPRE%3E%0A%3CP%3Efor%20amber%3C%2FP%3E%0A%3CPRE%3E%3D(E5%3DE%244)*(E5%26lt%3BE%243)%3C%2FPRE%3E%0A%3CP%3Eand%20for%20the%20red%3C%2FP%3E%0A%3CPRE%3E%3D(E5%26lt%3BE%244)*(E5%26lt%3BE%243)%3C%2FPRE%3E%0A%3CP%3EBe%20careful%20with%20absolute%20and%20relative%20references.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-735534%22%20slang%3D%22en-US%22%3ERe%3A%20Conditional%20Formatting%20using%20multiple%20conditions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-735534%22%20slang%3D%22en-US%22%3EThats%20brilliant%20Sergei.%20Thanks%20a%20lot%20for%20your%20help.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-736063%22%20slang%3D%22en-US%22%3ERe%3A%20Conditional%20Formatting%20using%20multiple%20conditions%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-736063%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F270033%22%20target%3D%22_blank%22%3E%40d32bus%3C%2FA%3E%26nbsp%3B%2C%20you%20are%20welcome%3C%2FP%3E%3C%2FLINGO-BODY%3E
d32bus
New Contributor

Hello

 

I was wondering if someone could help me. 

 

I work in training within law enforcement and have made a spreadsheet to help me keep track of what hours the officers work each year to stay proficient. The hours are broken down into modules (A1.1, A1.2, A2.1 etc)

 

Every four weeks a team attends training and each day a lesson will be covered which will contain a number of hours of each type of module. 

 

The spreadsheet has a list of the lessons and when an officer attends the lesson he will be marked as “attended”, this will then credit the officer with the appropriate amount of hours for each module contained within that lesson.

 

For example, Lesson A contains 1 hour module A1.1, 2 hours module A1.2 and 1 hour A2.1.

 

This will then add these hours to his scoresheet, by the end of the year the officer must have hit a certain number of hours on each module to stay proficient. 

 

Each training cycle I also have an officer benchmark, which says that if the officer has hit every available lesson that has been provided he will to date have accrued this many hours.

 

Image

 

As the spreadsheet currently stands, if the officer has hit the "benchmark" hours then his number for that particular module then the number will turn green. If the Officer has not attended the amount of lessons that have been provided then the number will turn red.

 

However for some of the modules, the officer only has to accrue 1 hour for the year but the number of times that it will be hit in lessons will be more than that (see I5).

 

What i'd like to be able to do is this....

 

If the number is higher than the "Total Required" then turn the text green.

 

If the number is equal to the "Benchmark" but less than the "Total Required" then turn the text amber.

 

If the number is less than both the "Benchmark" and "Total Required" then turn the text red.

 

I'm not great with Excel and hope someone can help me with this. I'm sure it's probably a simple answer but any help would be appreciated.

 

Many thanks

 

Rob

 

3 Replies
Solution

@d32bus 

You need three conditional formatting rules, one for each color. Select your entire range (e.g. E5:L11 as on picture) and add new rule using the formula. For green it'll be

=E5>E$3

for amber

=(E5=E$4)*(E5<E$3)

and for the red

=(E5<E$4)*(E5<E$3)

Be careful with absolute and relative references.

Thats brilliant Sergei. Thanks a lot for your help.

@d32bus , you are welcome