Hi. I am trying to understand how to determine if a line within a graph is sloping up or down using VBA. My app is related to Baseball. In Excel, I can create a Quick Analysis using 2 variables, Today's Batting Average (Today's Hits/Todays At Bats) and Overall Batting Average (Overall Hits / Overall At Bats) over time (a Game Date). So plotting Today's Average on the y axis and Game Date on the x axis as a line chart. Then adding Overall Average as a separate line on the chart. Finally, adding a Moving Average dotted line which shows the trend as it relates to the Overall Batting Average. On any particular day, the slope of the moving average trend line can be trending up, down or be flat. Very easy to see on the graph for a single player in Excel. I have an Access table with all of this baseball data, their hits and batting averages for each day of the baseball season. So, this is what I am looking for - if I were to take say 10 consecutive game dates (using 10 , but could be any amount of dates) for a player, on that 10th and last game date, I would like to determine whether the Moving Average which is tied to the Overall Batting Average is trending up, down or flat - within code. Any code snippets would be greatly appreciated! Here is some sample data
Player John Smith
Game Date - Overall Average - Today's Average
March 28 ---------- .400 --------------.400
March 29 -----------.300 --------------.200
March 30 -----------.429 --------------.750
March 31 -----------.533 -------------1.000
If you add to an excel spreadsheet and do a quick Analysis on that data adding series 1, series 2 and moving average you will see what I am trying to describe (hopefully ).
Player John Smith
Game Date - Overall Average - Today's Average
March 28 ---------- .400 --------------.400
March 29 -----------.300 --------------.200
March 30 -----------.429 --------------.750
March 31 -----------.533 -------------1.000
If you add to an excel spreadsheet and do a quick Analysis on that data adding series 1, series 2 and moving average you will see what I am trying to describe (hopefully ).