Conditional Formatting

Crewchief521

New Member
Joined
Apr 14, 2019
Messages
18
i have a spreadsheet setup with the NBA schedule. What i am trying to do is conditional format if a team played yesterday (back to back). its set up like this:
12/29/20196:00pOklahoma City Thunder98Toronto Raptors97
12/29/20198:00pCharlotte Hornets104Memphis Grizzlies117
12/29/20198:00pHouston Rockets112New Orleans Pelicans127
12/29/20198:00pSacramento Kings115Denver Nuggets120
12/29/20199:30pDallas Mavericks95Los Angeles Lakers108
12/30/201910:00pPhoenix SunsPortland Trail Blazers
12/30/20197:00pAtlanta HawksOrlando Magic
12/30/20197:00pMiami HeatWashington Wizards
12/30/20198:00pBrooklyn NetsMinnesota Timberwolves
12/30/20198:00pMilwaukee BucksChicago Bulls
12/30/20199:00pDetroit PistonsUtah Jazz

so with this data set i know that i will return 0 results because neither of these teams playing today (12/30/19) played yesterday (12/29/19), but in the instance they do i want to highlight them. i do have a cell (T1) that is formatted =today()-1 to retrieve yesterdays date. Any help would be appreciated, Thanks!!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
You did not say which cells you want to format. I am going to assume:
1. Your data starts in column A, row 1
2. You want to format the team name
3. You have more rows of data for more dates than you are showing in your example

Apply this formatting rule to the range $C:$C,$E:$E

=(COUNTIFS($C:$C,C1,$A:$A,$A1-1)+COUNTIFS($E:$E,C1,$A:$A,$A1-1))>0

This will format back-to-back playing dates regardless of what date is today or yesterday.
 
Upvote 0
You did not say which cells you want to format. I am going to assume:
1. Your data starts in column A, row 1
2. You want to format the team name
3. You have more rows of data for more dates than you are showing in your example

Apply this formatting rule to the range $C:$C,$E:$E

=(COUNTIFS($C:$C,C1,$A:$A,$A1-1)+COUNTIFS($E:$E,C1,$A:$A,$A1-1))>0

This will format back-to-back playing dates regardless of what date is today or yesterday.

Here is the actual data set starting in column A
11011122122100Tie-5.9%Thu, Jan 2, 202010:00pMemphis GrizzliesSacramento Kings
10911322222200Tie-28.4%Thu, Jan 2, 202010:30pDetroit PistonsLos Angeles Clippers
10910821621600Tie-5.0%Thu, Jan 2, 20207:00pCharlotte HornetsCleveland Cavaliers
10710621321300Tie1.5%Thu, Jan 2, 20207:00pDenver NuggetsIndiana Pacers
11010921921900Tie-21.0%Thu, Jan 2, 20207:30pToronto RaptorsMiami Heat
11111322422400Tie6.3%Thu, Jan 2, 20208:00pGolden State WarriorsMinnesota Timberwolves
10810621321300Tie-0.9%Thu, Jan 2, 20208:00pUtah JazzChicago Bulls
11011422422400Tie-29.3%Thu, Jan 2, 20208:30pBrooklyn NetsDallas Mavericks
11211022222200Tie-8.3%Thu, Jan 2, 20208:30pOklahoma City ThunderSan Antonio Spurs
10911422322300Tie-15.6%Fri, Jan 3, 202010:30pNew Orleans PelicansLos Angeles Lakers
10611522022000Tie-20.3%Fri, Jan 3, 20207:00pAtlanta HawksBoston Celtics
10910621421400Tie19.0%Fri, Jan 3, 20207:00pMiami HeatOrlando Magic
11711523223200Tie28.9%Fri, Jan 3, 20207:00pPortland Trail BlazersWashington Wizards
11211222422400Tie2.2%Fri, Jan 3, 20208:00pPhiladelphia 76ersHouston Rockets
10911322222200Tie-18.9%Fri, Jan 3, 20209:00pNew York KnicksPhoenix Suns

With using your conditional format, in this block of data i have "Atlanta Hawks", "Boston Celtics", "Philadelphia 76ers", and "Houston Rockets" highlighted for January 3rd. As you can see they do not play on January 2nd though. What am i missing in the formula. As to clarify your assumptions from previous post:
1. My data starts in A6
2. Yes i do want to format the team name (Columns M and O)
3. Yes, the sheet goes to row 1235
 
Upvote 0
Your actual data is very different than what you showed in the first post. You have to adjust the formula accordingly to use the correct columns and correct starting row.
 
Upvote 0
Your actual data is very different than what you showed in the first post. You have to adjust the formula accordingly to use the correct columns and correct starting row.

The formula i am using is in column M and O is =(countifs($M:$M,M6,$K:$K,$K6-1)+countifs($O:$O,O6,$K:$K,$K6-1))>0
 
Upvote 0
What do you want to use as the "Applies To" range for the CF?
 
Upvote 0
Apply this formatting rule to the range $M6:$M1235,$O6:$O1235. This is one range. Looks like you had it right but you must use M6 in both places.

=(COUNTIFS($M6:$M1235,M6,$K6:$K1235,$K6-1)+COUNTIFS($O6:$O1235,M6,$K6:$K1235,$K6-1))>0
 
Upvote 0
Apply this formatting rule to the range $M6:$M1235,$O6:$O1235. This is one range. Looks like you had it right but you must use M6 in both places.

=(COUNTIFS($M6:$M1235,M6,$K6:$K1235,$K6-1)+COUNTIFS($O6:$O1235,M6,$K6:$K1235,$K6-1))>0

I applied that formula now nothing highlights. This formula applies to M6:M1235 [|CODE]=(countifs($M6:$M1235,M6,$K6:$K1235,$K6-1)+countifs($O6:$O1235,M6,$K6:$K1235,$K6-1))>0[/|CODE]. It also applies to O6:O1235 as a separate condition though.
 
Upvote 0
It is all supposed to be one rule.

Do you have any way you can share your file?
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,135
Members
452,890
Latest member
Nikhil Ramesh

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