A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
The conditional formatting rule is applied on cell value based on formula. You may set different colors based on cell values.
If you have 7 shift pattern, set 7 rules for it.
-
IF(OR(NOT(ISNUMBER(J5));J5<Job1_StartDate);"";:- This part checks if
J5is not a number (NOT(ISNUMBER(J5))) or ifJ5is less thanJob1_StartDate. - If either condition is true, it returns an empty string (
""). - If both conditions are false, it proceeds to the next part of the formula.
- This part checks if
-
IF(MID(Job1_Pattern;MOD(J5-Job1_StartDate;LEN(Job1_Pattern))+1;1)=Job1_Shift1_Code;1;:-
MID(Job1_Pattern;MOD(J5-Job1_StartDate;LEN(Job1_Pattern))+1;1)extracts a single character fromJob1_Pattern. -
MOD(J5-Job1_StartDate;LEN(Job1_Pattern))+1calculates the position withinJob1_Patternbased on the difference betweenJ5andJob1_StartDate, ensuring it wraps around using theMODfunction. - If the extracted character equals
Job1_Shift1_Code, it returns1.
-
-
IF(MID(Job1_Pattern;MOD(J5-Job1_StartDate;LEN(Job1_Pattern))+1;1)=Job1_Shift2_Code;2;:- Similar to the previous step, but checks if the extracted character equals
Job1_Shift2_Code. - If true, it returns
2.
- Similar to the previous step, but checks if the extracted character equals
-
IF(MID(Job1_Pattern;MOD(J5-Job1_StartDate;LEN(Job1_Pattern))+1;1)=Job1_Shift3_Code;3;"")))):- Again, similar to the previous steps, but checks if the extracted character equals
Job1_Shift3_Code. - If true, it returns
3. - If none of the conditions are met, it returns an empty string (
"").
- Again, similar to the previous steps, but checks if the extracted character equals
In summary, this formula determines the shift code (1, 2, or 3) based on the date in J5 and a repeating pattern defined in Job1_Pattern. If J5 is not a valid date or is before Job1_StartDate, it returns an empty string.
For job pattern, you can find cell reference in Name Manager.
