The formula generator helps you build color coded lists or calendars in SharePoint 2007.
1/ Fill out the form. Based on your choices, the formulas are automatically updated at the bottom of the form.
2/ Paste the formulas in calculated columns in your list.
3/ Get the script available under the download tab and add it to the page, under your list.
See this article for detailed explanations.