change a cell based on dates from a data sheet in the same workbook

%3CLINGO-SUB%20id%3D%22lingo-sub-1920486%22%20slang%3D%22en-US%22%3Echange%20a%20cell%20based%20on%20dates%20from%20a%20data%20sheet%20in%20the%20same%20workbook%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1920486%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20data%20sheet%20with%20all%20my%20employees%20listed%20and%20it%20has%20their%20expiration%20dates%20from%20drivers%20license%2C%20med%20card%20and%20MVR%20expiration.%20Is%20there%20a%20way%20I%20can%20highlight%20a%20cell%20on%20other%20worksheets%20in%20the%20same%20workbook%20to%20change%20color%20when%20one%20or%20more%20of%20the%20dates%20are%20about%20to%20expire%20or%20have%20expired%20in%20the%20data%20sheet%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EExample%3A%20I%20have%20a%20cell%20on%20tab%20one%20with%20Johns%20Name.%20Can%20I%20change%20the%20cell%20color%20of%20that%20cell%20depending%20on%20the%20dates%20in%20tab%202%20for%20John.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJohn%20is%20in%20cell%20w2%20on%20tab%20one.%3C%2FP%3E%3CP%3EJohns%20expiration%20dates%20are%20in%20cells%20L2-N2on%20tab%20two.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1920486%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%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-1920521%22%20slang%3D%22en-US%22%3ERe%3A%20change%20a%20cell%20based%20on%20dates%20from%20a%20data%20sheet%20in%20the%20same%20workbook%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1920521%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F877198%22%20target%3D%22_blank%22%3E%40richardadair31%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet's%20say%20the%20sheet%20with%20the%20employee%20info%20is%20named%20Employees%2C%20with%20the%20employee%20name%20in%20column%20A.%3C%2FP%3E%0A%3CP%3EOn%20the%20other%20sheet%2C%20select%20the%20range%20with%20employee%20names%20in%20column%20W.%20I%20will%20assume%20that%20W2%20is%20the%20active%20cell%20within%20the%20selection.%3C%2FP%3E%0A%3CP%3EOn%20the%20Home%20tab%20of%20the%20ribbon%2C%20click%20Conditional%20Formatting%20%26gt%3B%20New%20Rule...%3C%2FP%3E%0A%3CP%3ESelect%20'Use%20a%20formula%20to%20determine%20which%20cells%20to%20format'.%3C%2FP%3E%0A%3CP%3EEnter%20the%20formula%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3DOR(VLOOKUP(W2%2C%20Employees!%24A%3A%24N%2C%2012%2C%20FALSE)%3CTODAY%3E%0A%3C%2FTODAY%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EClick%20Format...%3C%2FP%3E%0A%3CP%3EActivate%20the%20Fill%20tab.%3C%2FP%3E%0A%3CP%3ESelect%20a%20fill%20color.%3C%2FP%3E%0A%3CP%3EClick%20OK.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20do%20the%20same%20with%20variations%20of%20the%20formula%20and%20other%20colors%20if%20you%20wish.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1920664%22%20slang%3D%22en-US%22%3ERe%3A%20change%20a%20cell%20based%20on%20dates%20from%20a%20data%20sheet%20in%20the%20same%20workbook%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1920664%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F127945%22%20target%3D%22_blank%22%3E%40Hans%20Vogelaar%3C%2FA%3EIn%20your%20Formulas%20what%20does%20the%2012%20stand%20for%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20need%20to%20know%2030%20days%20or%201%20month%20ahead%20as%20a%20warning%20and%20then%20when%20it%20is%20expired%20to%20show%20red.%20For%20one%20of%20my%20Drivers%20It%20shows%20red%20but%20nothing%20expires%20for%206%20months.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I have a data sheet with all my employees listed and it has their expiration dates from drivers license, med card and MVR expiration. Is there a way I can highlight a cell on other worksheets in the same workbook to change color when one or more of the dates are about to expire or have expired in the data sheet?

 

Example: I have a cell on tab one with Johns Name. Can I change the cell color of that cell depending on the dates in tab 2 for John.

 

John is in cell w2 on tab one.

Johns expiration dates are in cells L2-N2on tab two.

7 Replies

@richardadair31 

Let's say the sheet with the employee info is named Employees, with the employee name in column A.

On the other sheet, select the range with employee names in column W. I will assume that W2 is the active cell within the selection.

On the Home tab of the ribbon, click Conditional Formatting > New Rule...

Select 'Use a formula to determine which cells to format'.

Enter the formula

 

=OR(VLOOKUP(W2, Employees!$A:$N, 12, FALSE)<TODAY(), VLOOKUP(W2, Employees!$A:$N, 14, FALSE)<TODAY())

 

Click Format...

Activate the Fill tab.

Select a fill color.

Click OK.

 

You can do the same with variations of the formula and other colors if you wish.

@Hans VogelaarIn your Formulas what does the 12 stand for?

 

I need to know 30 days or 1 month ahead as a warning and then when it is expired to show red. For one of my Drivers It shows red but nothing expires for 6 months.

@richardadair31 

It's slightly more complicated. See the attached version.

 

S0001.png

S0002.png

 

I used two defined names; you can view their definition in Formulas > Name Manager.

@Hans VogelaarI have tried the formulas over and over again.It doesnt seem to be working on My main Workbook. Ive attached what im working with and included the data minus the confidential stuff.

 

I will say I have only really been messing with Excel for about a year and it really has never been this in depth. This workbook we use to keep track of almost everything in our Trucking business. Every month I add a new tab and copy all this blank info into it. I would love to be able to use this same formula so and put it where it needs to go and that way no matter what month tab anyone is in they can see if any of our drivers has an issue.

 

Thank you for all the help btw. I kinda got it working before with just the first one. But then is was messed up on a guy and nothing was expired.

I should Mention I am using Office 365 on a Mac. This is also a shared workbook.

@richardadair31 

1) Since your data on the December sheet begin in row 7, the defined names should be created while you're in row 7, and they should refer to December!$B7.

2) Since the name of the Driver Info sheet contains a space, you must enclose it in single straight quotes in formulas: 'Driver Info'.

3) Since the expiration dates are in columns J to L, and not in L to N as you stated in your first post, the column numbers in VLOOKUP must be {10,11,12} instead of {12,13,14}.

See the attached version.

Thank you for the help. The Driver Info was the part that was messing me up. I did not know it had to have the single straight quotes when there is a space in the name. The date colums i had changed before i realized the numbers called for the columns. I was thinking the formula would see the older date of hire and date of birth. I had that part fixed just after i posted my last reply.

Again thank you for the help.