Hello masters,
For now I try to figure out but maybe someone has already the answer; I want to use excel to pair chess players using swiss system for tournament, in my case it will be maximum 30 players(player1, player2...), in first round they will be randomly paired, then rules are as below:
Winner : +1 point
Draw: 0.5 points both
Loose: 0 point

a
The number of rounds to be played is declared beforehand: In our case "5" rounds is OK.

b
Two players shall not play each other more than once

c
Should the total number of players be (or become) odd, one player is unpaired. He receives a bye: no color and as many points as are rewarded for a win

d
A player who, for whatever reason, has received any number of points without playing, shall not receive a bye.

e
In general, players are paired to others with the same score, if it is impossible they should pair with scores as close as possible, meaning for example at the final round (5th round) the strongest player can not match the player at 10th place or further, it must be someone around 3rd-6th place.

f
For each player the difference of the number of black and the number of white games shall not be greater than 2 or less than –2.
Each system may have exceptions to this rule in the last round of a tournament.

g
No player will receive the same color three times in a row.
Each system may have exceptions to this rule in the last round of a tournament.

h
1.In general, a player is given a color as many times as he is given the other color.
2.In general, a player is given the color other than that he was given the previous round.