Transpose column to row in Excel and Google Sheets

{=TRANSPOSE(A1:B1)} // doesn't ignore blanks

{=TRANSPOSE(FILTER(A1:B1, A1:B1<>""))} // ignore blanks

A2:B1 = Ranges

ArrayFormula use "Ctrl+Shift+Enter" for both formulas

Check below for a detailed explanation with pictures and how to use formulas in Excel and Google Sheets.