expand array and range condition