# Formula to spot upward trend

#### PCRIDE

##### Well-known Member
Hi, I am looking to create some sort of formula that can throw an alert for the user if the upward trend is increasing.

I need help with the algorithm

For example, Months Jan, Feb, Mar, Apr, May, Jun
Values
1024, 1130, 1250, 1375, 1425, 1250

Displaying this in a chart you could say the cost has increased month over month for 5 months before it started to decline.
The algorithm needs to detect the upward trend, not just if the next month is greater than than the previous month
The result needs to be text to tell the user about the upward trend.

Something like this is what I envision.

Month 1 has a cost
Month 2 , if greater than month 1, it would throw an alert, a text message in a box to a user
Month 3, if greater than month 2 and month 1, then throw an alert
Month 4, if greater than month 3, 4, 2, alert

I was thinking to use a basic If(AND , would this be the right approach? Any thoughts on a robust method? Considering one month that could dip, then if it shoots back up where the visual trend is still upward. Its like trying to put in text what a user would be thinking looking at a chart. "Yep the cost is increasing!"

#### PCRIDE

##### Well-known Member
Thinking about this more, what I need is a text based alert that I can alert the user when the rolling average has been observed as increasing. If it drops