Hello,
you need four conditional formats, one for each color. Select the cell. In the screenshot I selected cell A2. The formula will use the currently selected cell.
Create a conditional format with a formula, using
=A2-TODAY()>=30
Format to blue. Note that there are no $ signs in the cell reference. A2 is the current cell and using no $ signs in the formula will look at the current cell when you apply the format to other cells.
Create three more formats with these formulas:
=A2-TODAY()<=29 -- format to yellow
=A2-TODAY()<=14 -- format to orange
=A2-TODAY()<=5 -- format to red.
In the Rules Manager the rules should be in this order:
You can use the "Applies To" fields in this dialog to select the range for which the format should be applied, or you can copy the formatted cell and use Paste Special > Formats to copy the conditional format to other cells.
Let me know if that works for you.