Using Excel to Run Swiss?

Let us suppose that we have a swiss team event with a random number of tables between 6 and 20.  Therefore the tables are numbered 1 to n. Let us suppose further that we want to use the minimum number of sets of preduplicated boards for hand records. The hands are numbered 1-36 and the sets are number A, B, C, D, E and F since we are planning 4 matches of 6 boards each.

If the n/3 = an interger, then our first two rounds are round robin top to bottom (1,2 and 3; 4, 5 and 6; 7,8 and 9; etc.). After that the top n-3 teams play head to head swiss and the lowest ranking three teams play in a second round robin.

If n/2 = interger, then each match is head to head. If neither condition attaches (i.e., n=7, 11, 13, 17 or 19) then one single round robin match will occur and the remainder will be head to head. If n=11 or 13 or 17 or 19, no team may play in a round robin twice.

We are willing to make one set of boards for each 4 teams entered but would like to not make any more boards than necessary. We will often have at least some extra sets laying around prepared but not used for our pair game but we prefer not to need to count on that.

We would like an excel sheet (or other software) that tells us which pairs are matched and which boards should be used round to round.

We are also willing to forego strict "Swiss Pairings" in order to minimize board requirements if necessary:  For example in an 8 team contest suppose that teams 1 and 2 (Set A), 3 and 4 (Set B), 5 and 6 (Second Set A), 7 and 8 (Second Set B) pair off in the first round.  Now. if top of 1 and 2 faces top of 5 and 6 in match 2, they can clearly and with premeditation use Set B. Similarly for top of 3 and 4 against top of 7 and 8 and Set A. However, we would like to avoid distorting the "true swiss" movement to the extent possible.

I feel like this problem should be solvable on excel much as it is in the human mind only faster and with more accuracy, but I have been unable to find a way to use excel to let me "pick" from an  array (and then remove the item once picked). It is beyond my skill level.

I have this question out to a private resource, but I was wondering if anyone in the public knows of a solution.

The inputs I am willing to offer are teams matched and boards played. The output I am seeking is teams available for match and board available for play. To a lesser extent, I would like to solve for the minimum number of sets of boards to deal with n number of tables.