Not by formula. Excel formulas can only return values to the screen, they do not affect the formatting.
The way to control formatting is via Conditional Formatting, or through VBA.
But I don't think you can use Conditional Formatting to format just part of the entry. So I believe doing what you want would require VBA.