Here's another option to consider, using Excel's built-in efficiencies with Tables and Pivot Tables.
- Convert your data into columns
Data > Text-to-Columns
- Create an Excel Table from your data (with a cell in your data selected)
Insert > Table
- Create a Pivot Table from your Table (with a cell in your Table selected)
Insert > Pivot Table
, with the following settings:- Column Labels: Column 1
- Row Labels: Distance Along Transact
- Values: Average of Grain Size
- Create a Pivot Chart from your Pivot Table (with a cell in your Pivot Table selected)
Insert > Charts > 2-D Column Chart
Now, without any formulas you have a linked series of objects that will refresh with changes amongst them (e.g. adding rows to your data table, filtering your pivot chart or pivot table).
To get maximum value from this solution, you can set your table up to automatically refresh from different data sources (e.g. SQL Server), ensuring your tables/charts are always up-to-date.