conditional formatting formula for two-leg match tie-breaker

valmir

Active Member
Joined
Feb 10, 2021
Messages
267
Office Version
  1. 365
Platform
  1. Windows
Hello everyone
I have attached a file with two teams. Team AAA won the first leg 3-1, team BBB won the second leg 2-0. Both teams ended up with a +2 goal difference. However, team BBB had the advantage of having 1 goal scored compared to 0 goal of AAA (as away teams) so, basically we will have a first condition which is if the sum of goals scored by each team is equal, then the second condition applies to the goals scored as an away team.
So the formula would be something like:
formula for A1
(B1+C1)=(B2+C2) and C1>B2
formula for A2
(B1+C1)=(B2+C2) and B2>C1
I want each formula to highlight green whichever team meets the criteria, in this case A2 (BBB)

Book1
ABC
1AAA30
2BBB12
Sheet1
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
There is probably a more elegant solution, but try this:

I needed to add an indicator for who the AWAY team is.
I'll be conditionally formatting in a moment.

Book1
ABC
1
2AAA30
3BBB12
4AWAYBBBAAA
5
6WinnerBBB
Valmir
Cell Formulas
RangeFormula
B6B6= IF(SUM(B2:C2)>SUM(B3:C3),A2,IF(SUM(B2:C2)<SUM(B3:C3),A3, IF(SUM((B$4=$A$2:$A$3)*(C$2:C$3))>SUM((B$4=$A$2:$A$3)*(B$2:B$3)),B$4, IF(SUM((B$4=$A$2:$A$3)*(B$2:B$3))<SUM((B$4=$A$2:$A$3)*(B$2:B$3)),B$4,"Draw"))))
 
Upvote 0
IF(SUM(B2:C2)>SUM(B3:C3),A2,IF(SUM(B2:C2)<SUM(B3:C3),A3, IF(SUM((B$4=$A$2:$A$3)*(C$2:C$3))>SUM((B$4=$A$2:$A$3)*(B$2:B$3)),B$4, IF(SUM((B$4=$A$2:$A$3)*(B$2:B$3))<SUM((B$4=$A$2:$A$3)*(B$2:B$3)),B$4,"Draw"))))
ok thanks. Waiting for your kind reply! :)
 
Upvote 0
Please note that for the first leg BBB is the away team and AAA is the away team in the second leg, meaning that BBB in the first leg scored 1 and AAA in the second leg didn't score that's why BBB moves forward!
 
Upvote 0
Please note that for the first leg BBB is the away team and AAA is the away team in the second leg, meaning that BBB in the first leg scored 1 and AAA in the second leg didn't score that's why BBB moves forward!
i think that is what my formula does. If it does not, please let me know. As I think it displays BBB as winning in your scenario.
 
Upvote 0
argh. I'm drawing blanks on getting the CF correct. I need to take a break from this for a while. My apologies.
 
Upvote 0
It's a bit 'icky', but see if this gives you what you want:
Book1
ABC
1AAA30
2BBB12
3
4AAA03
5BBB21
6
7AAA11
8BBB11
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A8Expression=(B8+C8)>(B7+C7)textYES
A7Expression=(B7+C7)>(B8+C8)textYES
A8Expression=B8>C7textYES
A7Expression=C7>B8textYES
A5Expression=(B5+C5)>(B4+C4)textYES
A4Expression=(B4+C4)>(B5+C5)textYES
A5Expression=B5>C4textYES
A4Expression=C4>B5textYES
A2Expression=(B2+C2)>(B1+C1)textYES
A1Expression=(B1+C1)>(B2+C2)textYES
A2Expression=B2>C1textYES
A1Expression=C1>B2textYES
 
Upvote 0
It's a bit 'icky', but see if this gives you what you want:
Book1
ABC
1AAA30
2BBB12
3
4AAA03
5BBB21
6
7AAA11
8BBB11
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A8Expression=(B8+C8)>(B7+C7)textYES
A7Expression=(B7+C7)>(B8+C8)textYES
A8Expression=B8>C7textYES
A7Expression=C7>B8textYES
A5Expression=(B5+C5)>(B4+C4)textYES
A4Expression=(B4+C4)>(B5+C5)textYES
A5Expression=B5>C4textYES
A4Expression=C4>B5textYES
A2Expression=(B2+C2)>(B1+C1)textYES
A1Expression=(B1+C1)>(B2+C2)textYES
A2Expression=B2>C1textYES
A1Expression=C1>B2textYES
Not working. I'm sorry that this seems to be really complicated. I had no idea when I made this request! Thanks for your effort!
 
Upvote 0
Not working.
My understanding was that you wanted to highlight in green the winner of matches where the result was decided by away goals. If that's not the case then I got your intentions all wrong. If I was right in divining your intentions, then using the sample I provided in post #8, could you please explain what exactly "not working" means?
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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