This should be a field on the table as a Rich text fomrula field and not a Custom data rule.
Try this to fix the formula.
If(
IsNull([Appointment Scheduled]) and ToDays(Today() - [Appointment Needed By]) >=1 , "<span style=\"color:#ff0707; font-weight:bold\">"&"OverDue"&"</span>" ,
IsNull([Appointment Scheduled]) and ToDays(Today() - [Appointment Needed By]) >=-7 , "<span style=\"color:# FFDD33; font-weight:bold\">"&"Upcoming"&"</span>"
)
// I left out the last part of the formula as it was incomplete.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.commark.shnier@gmail.com
------------------------------