Not sure if you wanted worksheet functions or VBA to do this and if you want
VBA, if you need further instructions and also how you want to initiate the
running of the macros to change the fonts. The following two activate on
changes to cells. (You can only use one of them. See the comments following
the sub name for what activates them).
Right click on the tab sheet name and select View Code and copy one of the
macros into the VAB editor. To close the VBA editor, click on the X with the
red background top right of VBA editor window.
First Option:-
Private Sub Worksheet_Change(ByVal Target As Range)
'Changes the colors of Cell A1 based on a change to the cell A1
Select Case Target
Case Range("A1")
With Target
.Characters(1, Cells(2, "A")).Font.Color = vbRed
.Characters(5, Cells(3, "A")).Font.Color = vbBlue
End With
Case Range("B1")
'Another option here
Case Range("C1")
'Another option here
End Select
End Sub
Second option:-
Private Sub Worksheet_Change(ByVal Target As Range)
'Changes the colors based on a change to either A2 or A3
Select Case Target
Case Range("A2"), Range("A3")
With Range("A1")
.Characters(1, Cells(2, "A")).Font.Color = vbRed
.Characters(5, Cells(3, "A")).Font.Color = vbBlue
End With
Case Range("A4"), Range("A5")
'Further options here if required
End Select
End Sub