Is there a formula to indicate the change in status direction if updated in a given time?

I want to indicate with up/down arrows in a separate column, if the RYG status for a line item has changed direction in the last X days. e.g. if status went from Red to Yellow, Red to Green, Yellow to Green in the last 30 days - show an upward arrow; if status went from Green to Yellow, Yellow to Red, or Green to Red in the last 30 days- show a downward arrow symbol. is that possible?