I was having some problems getting nested IF statements to work and I thought this maybe helpful to others.
I wanted to change the default background colour in a column in a table based on the value in the column and this was the structure of the IF statement that worked for me.