How to create a formula for forecast that runs everytime a value in column A changes

katiem_7626

New Member
Joined
Aug 19, 2013
Messages
2
I have a spreadsheet with thousands of records relating to samples at water monitoring stations. Each sample is from a specific station of which there are over 1000. Each relates to a sample, so station IDs are repeated many times in rows. I need to run a macro that will use the forecast function to predict a sample value from each station. So everytime the station changes, a new forecast function will be ran on the sample values, producing a new prediction value for every station. I am struggling with building a macro - I know how to do the forecast function, but have far too much data to run it individually for each station. Any help would be greatly appreciated.<o:p></o:p>
Katie<o:p></o:p>
 
I don't think you need a macro for this.

Formula approach:
1) Sort the data by station
2) Use advanced filter to make a list of all unique station names
3) Insert below formula to the right of the unique station name list, copy down

Assumed setup. Row 1 has headers, Column A has the station name, column B the date and column C the data. List of unique station names is in column E. The date to be forecasted is in cell F1, and the formulas go from F2 and down.

Formula in F2:
Code:
=FORECAST($F$1,OFFSET($C$1,MATCH(E2,$A$2:$A$10000,0),0,COUNTIF($A$2:$A$10000,E2)),OFFSET($B$1,MATCH(E2,$A$2:$A$10000,0),0,COUNTIF($A$2:$A$10000,E2)))
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top