Conditional formatting based on multiple worksheets

krguyton

New Member
Joined
Dec 21, 2018
Messages
13
I need some help with conditional formatting. I have a file in which there several different work sheets (different company's) which all have a column for contract expiration dates. I have conditional formatting setup to highlight any dates that are set to expire in the next 180 days from the current day. I created a summary sheet with the titles of the other sheets (company names). I would like to apply conditional formatting to the summary sheet that will highlight the name of the company that has expiration's coming up. Basically, if a company has any contracts set to expire in the next 180 days, the cell for that company name should be conditionally formatted.

Any help is greatly appreciated. Thank you.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Assuming your date column is in column C on each company sheet:

Book1
A
1Company
2
3IBM
4Apple
5Microsoft
6
7
Summary
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A:AExpression=COUNTIF(INDIRECT("'"&A1&"'!C:C"),"<="&TODAY()+180)textNO
 
Upvote 0
Thanks for the reply. How does the summary sheet formula know which cell is associated to which sheet? (i.e. which sheet corresponds to IBM expiration's and so on.)
 
Upvote 0
The formula assumes the sheet name is the same as the company name, so the contents of A3 is IBM, so it looks for a sheet named IBM. If that's not always true, you'll need to add a lookup table somewhere to find the sheet name from the company name. Like:

Book1
ABCD
1CompanyCompanySheet
2IBMIBM1
3IBMAppleApple 2
4AppleGoogleABC
5MicrosoftMicrosoftMS1
6
Summary
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A:AExpression=(COUNTIF(INDIRECT("'"&VLOOKUP(A1,$C$2:$D$6,2,0)&"'!C:C"),"<="&TODAY()+180))textNO
 
Upvote 0
The formula assumes the sheet name is the same as the company name, so the contents of A3 is IBM, so it looks for a sheet named IBM. If that's not always true, you'll need to add a lookup table somewhere to find the sheet name from the company name. Like:

Book1
ABCD
1CompanyCompanySheet
2IBMIBM1
3IBMAppleApple 2
4AppleGoogleABC
5MicrosoftMicrosoftMS1
6
Summary
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A:AExpression=(COUNTIF(INDIRECT("'"&VLOOKUP(A1,$C$2:$D$6,2,0)&"'!C:C"),"<="&TODAY()+180))textNO

Doesn't seem to be working. I changed the formula slightly because my company list for the summary page is in the B column starting at B2 and the expirations of the various sheets are on column F, starting at F2. I added this formula using "new rule" under conditional formatting with the company cells highlighted. Am I missing something?
 
Upvote 0
Very possibly! It doesn't take much to make a formula not work, just a misplaced $ sign can do it. In order to figure out what's off, I need to see the formula you're using, the range you're applying it to, a sample of your lookup up table (where it is and what's in it), and confirm where the dates are in each company sheet. If you can use the XL2BB tool (see the button in the response box), that would be ideal. That's what I've been using, and you can see how useful that is.
 
Upvote 0
Here is the formula: =(COUNTIF(INDIRECT("'"&VLOOKUP(B1,$F$2:$G$6,2,0)&"'!F+$F$2:F"),"<="&TODAY()+180))
Here is the Summary page also showing the conditional formatting:
1594320856037.png

Here is the date location on the company sheets:
1594320933864.png

Should the summary page be assigned as a lookup table?
 

Attachments

  • 1594320718819.png
    1594320718819.png
    42.6 KB · Views: 2
  • 1594320780074.png
    1594320780074.png
    51.2 KB · Views: 2
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,042
Members
448,940
Latest member
mdusw

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