Data
I have a table B3:F7
with a changing range, more or less rows and columns.
Objective
I want to Rotate the original table using the input from the drop down I2:M2
to get the result like 90, 180, 270 Rotation.
To clarify
- I don't want to choose between them; I want the original table to be Rotated according to the input of the dropdown. I have only the original table and the data is mixed and the range is growing.
- The formatting is for demonstration only.
Progress
I tried transpose twice =TRANSPOSE(TRANSPOSE(B3:F7))
to get 180 result, but the output is reverted back to the original form B3:F7
.
Sources
CodePudding user response:
try:
=ARRAYFORMULA(IF(I2=O3, B3:F7,
IF(I2=O4, TRANSPOSE(SORT(B3:F7, ROW(B3:F7), 0)),
IF(I2=O5, TRANSPOSE(SORT(TRANSPOSE(SORT(B3:F7, ROW(B3:F7), 0)), ROW(B3:F7), 0)),
IF(I2=O6, SORT(TRANSPOSE(B3:F7), ROW(B3:F7), 0), )))))