Conditional Formatting Two Conditions. Date and Contract Number

CascadeDiver

Board Regular
Joined
Apr 10, 2020
Messages
62
Office Version
  1. 2016
Platform
  1. Windows
Good day

I have two tables. Table A has Contract Numbers. Table B has Contract Numbers, Dates, and Units Sold
I would like to have conditional formatting to highlight the Contract Numbers in Table A if an entry is made in Table B on today's date. This will give a visual indication if one of the Contracts in Table A has no entries in Table B on today's date.

I am having a difficult time coming up with the conditional formatting formula, possibly sumifs.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I would say countifs rather than sumifs. As we don't know exactly how your sheet is laid out, I've used descriptions in place of ranges.

=COUNTIFS(Table B'AllContractNumbers,Table A!SingleContractNumber,Table B!AllDates,TODAY())
 
Upvote 0
I would say countifs rather than sumifs. As we don't know exactly how your sheet is laid out, I've used descriptions in place of ranges.

=COUNTIFS(Table B'AllContractNumbers,Table A!SingleContractNumber,Table B!AllDates,TODAY())

I plugged in the table and column names but get an error problem with the formula

=COUNTIFS(Harvest_Data_Tbl[CONTRACT],Quoat_Contract_Tbl[CONTRACT],Harvest_Data_Tbl[DATE],TODAY())

I tried this as a regular formula and replaced the second criteria with a specific cell in the column range and the formula works fine though
 
Upvote 0
I replaced named ranges with cells and got it working

Thank you for your help

=COUNTIFS('Harvest Log'!$A$9:$A$157,$B4,'Harvest Log'!$B$9:$B$157,TODAY())
 
Upvote 0
Almost there. Unfortunate when I add an entry to the database the formatting range 'Harvest Log'!$A$9:$A$157 shifts down one row
 
Upvote 0
You can't use table names / named ranges as the range for conditional formatting (as it looks like you've already discovered).

If you're inserting new rows at the top of the table, then I think that including the header row in the CF range should work.

I'm not sure if it will expand with new rows added to the bottom though, conditional formatting doesn't seem to like dynamic ranges of any kind.
 
Upvote 0
You can't use table names / named ranges as the range for conditional formatting (as it looks like you've already discovered).

If you're inserting new rows at the top of the table, then I think that including the header row in the CF range should work.

I'm not sure if it will expand with new rows added to the bottom though, conditional formatting doesn't seem to like dynamic ranges of any kind.

You are correct, I am adding data to the top of the table. I changed the column ranges to use the entire column, that seems to do the trick. I'll try the Header Row if this doesn't pan out.

Again, thank you for your help :)
 
Upvote 0
Conditional formatting triggers something known as volatile calculation. Using the entire column, you might notice some delay whenever you make changes to the sheet.
 
Upvote 0

Forum statistics

Threads
1,215,750
Messages
6,126,663
Members
449,326
Latest member
asp123

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