I am trying to create an Excel spreadsheet where, when I input a date:
 if that date is within 30 days it will go yellow,
 if the date has already gone then it goes red, and
 if the date is more than 30 days away it remains green.
How can I do that?
I am trying to create an Excel spreadsheet where, when I input a date:
How can I do that? 


I don't believe you can do this directly in a formula but you can use the Conditional Formatting dropdown with a formula. This blog post has a good writeup of the steps needed. Also this article walks thru the steps. 


In Excel 2010 (possibly earlier versions) you can use a formula to determine formatting. Select the cell with your date in it and then select conditional formatting, new rule. Then "Use a formula to determine which cells to format" Use something like Change the formula and colours as necessary. This should do for more than 30 days in the future: This should do for the next 30 days rule: Rules will need to be in the right order. This may not be the most elegant way but it's a start. 


I could do it in Excel 2010 by adding two rules to the cells where the dates are inputted. Choose Conditional Formatting > Manage Rules 1st rule > "Use a formula to determine which cells to format"
Choose Format > Green 2nd rule >
Choose Format > Red Check "Stop if true" for each of the rules in the Conditional Formatting Rules Manager, and then apply a yellow base formatting to the cell which will be default if the conditions do not apply. 

