问题
The spreadsheet I am devising is to help me with the scoring of a football (or soccer depending where you're from) forum game I run. The idea is that each player picks 10 football teams and they get a point for each goal scored. However, they also pick one team which they think will not score any goals. If their team doesn't score they get 3 points but if the team does score they lose a point for every goal the team scores.
For example - Example A) The player picks Man Utd to not score a goal but they score 3. This means that the player would score -3 points. Example B) The player picks Man Utd to not score a goal and they don't. This means that the player would score 3 points.
Is there a way to create a formula for this specific selection to go into cells F13
and J13
which would match the team in the list in Column A to what I have entered in Column D and H and if the score next to this team (in Column B) is "0" it allocates 3 points to the cell F13
and J13
but if the score in Column B is above 0 (eg 3), the value in cell F13
and J13
reads as minus the value shown in Column B (eg -3).
Template spreadsheet can be found here - https://docs.google.com/spreadsheets/d/1DNOVUGPAJF-nR9XtQ1fc-lqm4fYHNBJgz7-rr6SzJaU/edit?usp=sharing (not sure if I have set it correctly to allow editing but if I have then feel free to edit away)
Hope this makes sense!
回答1:
Please use the following formula on your F13
cell (and all the corresponding ones for the rest of the players)
=IF(-VLOOKUP( D13,$A$2:$B,2,0)=0,3,-VLOOKUP( D13,$A$2:$B,2,0))
You could probably use a single formula on your F1
cell.
=ArrayFormula(IF(C1:C11=TRUE,C1:C11*E1:E11,1))
Functions used:
- ArrayFormula
- IF
- VLOOKUP
来源:https://stackoverflow.com/questions/64955984/formula-to-create-multiple-possible-results