When you are editing a cell you may notice that most of the ribbon icons are greyed out, because you can’t use them. The formatting tools however are not greyed out.
You can select part of the text in a cell and format it differently to the rest of the cell.
See example below.

