In one version of the familiar ‘secretary problem’, n rankable individuals appear sequentially in random order, and a selection procedure (stopping rule) is found to minimize the expected rank of the individual selected. It is assumed here that, instead of being a fixed integer n, the total number of individuals present is a bounded random variable N, of known distribution. The form of the optimal stopping rule is given, and for N belonging to a certain class of distributions, depending on n, and such that E(N) → ∞ as n → ∞, some asymptotic results concerning the minimal expected rank are given.