or alternatively you could not bother coding for it and use the 'conditional formatting' function in Excel which will set the background colour and font colour based on cell value.
There are only two variables here so set the default to yellow and then overwrite when the value is greater than or less than your threshold values.