Using the Expand or Collapse the Formula Bar Shortcut
Windows keyboard shortcut
Mac keyboard shortcut
This Excel shortcut toggles the formula bar between collapsed and uncollapsed state.
Other useful Formula keyboard shortcuts