PDA

View Full Version : Solved: Tally Domino game score



Victor
12-31-2008, 10:28 AM
I upload a Domino.xls file.

What I need is advice in filling automatically the columns with name " Num Jugada" with the number that corresponds to the winning game.

For example:
1-If the frst game to win is " Nosotros" I write a 1 in D1.
2-If " Nosotros win again in cell D2 I write 2
3-If "Ellos" win the third game I write 3 in cell L1
4-If " Nosotros" win the fourth game I write 4 in D3

As you see there is a sequence in the numbers assigned but the cell where is assign depends of who wins the game.

Any ideas how can I write this number automatically.

I try with if but do not have exit.
Then try with VBA code but have no idea to where to begin.

Any advice of which method I should use to do it automatically?

Thanks for the help.

Victor

Bob Phillips
12-31-2008, 11:24 AM
D5: =IF(H5>P5,ROW(A1),"")

L5: =IF(H5>P5,"",ROW(A1))

and copy down

Victor
12-31-2008, 04:20 PM
Hi:

What I am looking for is somthig like this:

D H L P
1 1 87 3 10
2 2 78 4 2
3 5 12
4 6 100

The first game won by 1st column group by 87 points -then D1 =1
The second game is won by first column again by 78 points -then D2=2
The third game is won by second column by 10 points - then L1=3
The fourth game is won by second column group by 2 points then L2=4

The 2 column are independent one of each other. The column D and L only assigns the number in a sequence only to the team that wins.

In this sample the first team won games 1,2,5,6
the second team won games 3 and 4

After finished each game the person with more points is the winner

In this sample team column H and P only show the total points that this group won each time they played.

The formula suggested by you compares on column to the other for each row but one column H, is independent of the other ,column P.

The purpose is to give price points to the team who wins that particular game number.

For example is the first team wins game 4 I have a vlookup that looks for number 4 under column D or L and assigns the winning points to the running total.


Please see attachment.

Thanks

Victor

Victor
01-01-2009, 02:59 PM
Here is my solution:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 7 Then
On Error Resume Next
If Len(Target) > 0 Then
Target.Offset(0, -3).Value = Application.WorksheetFunction.Max(Application.WorksheetFunction.Max(Range("D6:d48")), Application.WorksheetFunction.Max(Range("L6:L48"))) + 1
End If
End If
If Target.Column = 15 Then
On Error Resume Next
If Len(Target) > 0 Then
Target.Offset(0, -3).Value = Application.WorksheetFunction.Max(Application.WorksheetFunction.Max(Range("D6:d48")), Application.WorksheetFunction.Max(Range("L6:L48"))) + 1
End If
Else
End If
End Sub

See enclosed DominoF.xls with the program detail

Victor