You can deal with 18 teams by taking this square:
(H N) (D I) (C R) (M E) (A F) (P G) (L O) (Q J) (B K)
(A E) (C K) (H G) (L F) (Q O) (M N) (D J) (B I) (P R)
(Q F) (H R) (A N) (D O) (B J) (L E) (C I) (P K) (M G)
(M I) (B E) (P O) (A K) (L R) (H J) (Q G) (D N) (C F)
(P J) (Q N) (B F) (H I) (M K) (C O) (A R) (L G) (D E)
(B O) (A G) (Q E) (C J) (P I) (D F) (H K) (M R) (L N)
(L K) (P F) (M J) (Q R) (D G) (A I) (B N) (C E) (H O)
(D R) (M O) (L I) (B G) (C N) (Q K) (P E) (H F) (A J)
(C G) (L J) (D K) (P N) (H E) (B R) (M F) (A O) (Q I)
If the 9 columns are the events then simply assign the final column to be a 'bye event' where people sit out. Similarly for 20 teams take this square:
(C Q) (H I) (O T) (L K) (S R) (M G) (J A) (F D) (E P) (B N)
(O G) (E A) (C D) (S I) (B P) (F Q) (M N) (L T) (H K) (J R)
(H D) (C K) (E G) (J T) (M I) (L N) (B R) (S Q) (F A) (O P)
(F P) (S G) (L R) (H A) (J Q) (O K) (E T) (C N) (B I) (M D)
(B T) (O R) (J I) (E D) (F G) (H P) (L Q) (M K) (S N) (C A)
(J K) (B D) (M A) (F R) (H N) (S T) (C P) (E I) (O Q) (L G)
(L I) (J N) (S P) (C G) (O D) (B A) (F K) (H R) (M T) (E Q)
(S A) (M Q) (B K) (O N) (C T) (E R) (H G) (J P) (L D) (F I)
(E N) (F T) (H Q) (M P) (L A) (J D) (O I) (B G) (C R) (S K)
(M R) (L P) (F N) (B Q) (E K) (C I) (S D) (O A) (J G) (H T)
and assign the last two columns to be 'bye events'. I think that's where I run out of advice, as I don't have any software that might handle an odd number of teams.