Limit theorems for univariate and bivariate order statistics with variable ranks