Use Excel TRANSPOSE Function to change the orientation of a range. In simple words, by using transpose function in excel you can change the data from a row into a column and from a column into a row.
array An array or a range you want to transpose.
More Information on Excel Transpose Function
You have to apply TRANSPOSE Function as an array formula using the same number of cells as you have in your source range by pressing Ctrl + Shift + Enter.
If you select cells less than source range, it will transpose data only for those cells. For example, In source range, you have 8 cells and in destination range, you have selected 6 cells then it will only transpose data from 6 cells.