You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Calculate a game's points for a team in a column depending on where the team name is in the row.

Hello,

I'm looking for a way to calculate a game's points for a team (Montreal) in column G depending on where the team name is in the row.


In the example below, Montreal is in column B when he is outside and in column E when he is at home. So, depending on that location, Montreal's result will be in column C or D. If Montreal wins the game, it gets 2 pts. If he loses, it's 0 pts and if he loses in overtime it's 1 pts.


thank you for helping me

MA


iMac 21.5″, macOS 11.0

Posted on Dec 7, 2020 12:16 PM

Reply
Question marked as Top-ranking reply

Posted on Dec 7, 2020 3:42 PM

I see no place to indicate that a game has gone into overtime, so I've inseted a new column with an OT checkbox to the left of the PTs column.

Since you've not mentioned it, I assume a tie is not possible.


Here's a map of the formula:


IF(                                                                                                     ,2,IF(G2,1,0))

    OR(                                                                                              )

          AND(                                     ),AND(                                    )

                   B2="Montréal",C2>D2           E2="Montréal",C2<D2


And a text copy that may be pasted into the formula editor for H2, then filled down.


H2: IF(OR(AND(B2="Montréal",C2>D2),AND(E2="Montréal",C2<D2)),2,IF(G2,1,0))


The formula starts with the AND statements.

If either is TRUE, then Montréal has won the game, OR will return TRUE, and IF will return 2 to the PTs cell.

If both are False, then either Montréal has not won or is not named in this row of either column B or column E, and IF passes on the the second IF.

The second IF gets TRUE (checked) or FALSE (unchecked) from the OT checkbox, and returns 1 (if true) or 0 (if false)to the PTs cell.


Assuming you are tracking ONLY games played by les Habs, the formula will work as desired. If theres a Boston-Toronto game on the list, the formula as written will place a zero or one in the PTs depending only on whether the OT box has been checked.


Regards,

Barry

2 replies
Question marked as Top-ranking reply

Dec 7, 2020 3:42 PM in response to Marc-Andr St-Pierre

I see no place to indicate that a game has gone into overtime, so I've inseted a new column with an OT checkbox to the left of the PTs column.

Since you've not mentioned it, I assume a tie is not possible.


Here's a map of the formula:


IF(                                                                                                     ,2,IF(G2,1,0))

    OR(                                                                                              )

          AND(                                     ),AND(                                    )

                   B2="Montréal",C2>D2           E2="Montréal",C2<D2


And a text copy that may be pasted into the formula editor for H2, then filled down.


H2: IF(OR(AND(B2="Montréal",C2>D2),AND(E2="Montréal",C2<D2)),2,IF(G2,1,0))


The formula starts with the AND statements.

If either is TRUE, then Montréal has won the game, OR will return TRUE, and IF will return 2 to the PTs cell.

If both are False, then either Montréal has not won or is not named in this row of either column B or column E, and IF passes on the the second IF.

The second IF gets TRUE (checked) or FALSE (unchecked) from the OT checkbox, and returns 1 (if true) or 0 (if false)to the PTs cell.


Assuming you are tracking ONLY games played by les Habs, the formula will work as desired. If theres a Boston-Toronto game on the list, the formula as written will place a zero or one in the PTs depending only on whether the OT box has been checked.


Regards,

Barry

Dec 8, 2020 11:18 AM in response to Barry

Thank you very much Barry,


This formula works "Number One", as we say in English in my part of the country.


The only problem with this kind of formula is the accumulation of functions in order to know how to use them well. For example, I had an idea with the "<" (smaller than) and the ">" (larger than) but it only worked well if Montréal was always on the same side of the board. Above all, we need to understand how to use checkboxes.


I also mean, for my French speaking comrades using Numbers in French, that all commas (,) in the formula should be changed to semicolons (;).

Thanks again.


MA

Calculate a game's points for a team in a column depending on where the team name is in the row.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.