# What code?

#### collinsc

##### Board Regular
Hi, me again!

I am attempting to do a spreadsheet to note peoples performance in my local pool team.

I though i could use 0 as a loss and 1 as a win.
Can i get a formula to recognise the name "darren" and how many instances of "0", how many instances of "1" and the percentage of losses to wins?

here is how i thought i would lay it out:
Singles:
Game 1 Darren 0 1
Game 2 Chris 1 0

Doubles:
Game 3
Darren 1 and Chris 1
Jamie 0 and Dave 0

obviously for doubles i would have to put 2 lots of results down...

any suggestions welcomed!

Thanks

### Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hello,

It all depends on the data layout,

If A1 = Darren and

B1-J1 has his wins/losses you could use in K1

=COUNTIF(\$B\$1:\$J\$1,"<2")

to count tht total games played and in L1

=COUNTIF(\$B\$1:\$J\$1,"=1")

to count his wins, then use

=L1/K1 formatted as a percentage

thanks for responding

does <2 mean under 2? in which case that would recognise the 0 and the 1 wouldnt it?

could i use the one you mention:
=COUNTIF(\$B\$1:\$J\$1,"=1")
to recognise if the number of occurences for "1" and then
=COUNTIF(\$B\$1:\$J\$1,"=0")
for the no of occurences of "0" and then compare them as a percentage?

Hello,

Yes, you can.

Thanks!

Hi

I have come across an issue. The issue is... the same player will not necessarily play every week, so can i get it to recognise someones name?

i.e "where DARREN = "0"........" where Darren ="1""??

any suggestions

thanks

Hello,

Can you give a clearer description of the layout?

Sure... this is what i had in mind... as mentioned the 1 and 0 is used to represent WIN or LOSE, as i assumed numbers would be better than "WIN" and "LOST" !

this is for "week 1" i then want to do "week 2" and calculate the success % of players as the season progresses.

There may be an easier way to do it? Thanks

Game 1 Darren 0 1
Game 2 Dave 1 0
Game 3 Chris 1 0
Game 4 Jamie 1 0
Game 5 Kristian 0 1
Game 6 Vince 0 1

Doubles 1 Chris 1 0
Vince 1 0

Doubles 2 Dave 0 1
Mark 0 1

Doubles 3 Kristian 1 0
Shorty 1 0

Captains Jamie 1 0

Result 6 4

Replies
9
Views
1K
Replies
8
Views
242
Replies
10
Views
585
Replies
3
Views
599
Replies
9
Views
437

1,219,906
Messages
6,150,908
Members
450,991
Latest member
ExcelDoer

### 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.

### Which adblocker are you using?

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

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