Make Excel ribbon less gigantic
4th icon from the very upper-left corner allows you to select additional commands to add to the quick command bar up there.
One of these options is Touch/Mouse Mode. Click this to add the button to the bar.
Now click this new button (it looks like a hand with a pointing finger) and change it to Mouse.
I'm not sure how you switched, but it looks as though you went into Touch Mode, which spaces the buttons on the ribbon further apart so they are more finger-friendly. Switching back should shrink the bar back.