The formula to do the calculations is actually very simple. It is your specification to have the results only displayed on specific rows that makes the calculations a bit messy.
When a formula is applied to a given column, JMP simply takes the formula and applies it to row 1, then row 2 and so on to the last row in the table. Therefore, the below formula will give you the answers you want
Col Mean( :"Amount of Cyanidin (ng/kg)"n, :Sample Number )
Basically the formula calculates the mean for the column "Amount of Cyanidin (ng/kg)" and write it out to the row for the column. Because there is also a By column specified, "Sample Number" it calculates the mean for each level found for the "Sample Number" and then writes it out to the row for the new column.
But your requirement was to only display the mean value on the last row for each of the "Sample Numbers". To identify which rows those are, there needs to be something that programmatically can be evaluated. In this case, I chose to check to see if the value of "Sample Number" changes in the row after the current row being processed. So that changes the formula to
If( :Sample Number != :Sample Number[Row() + 1] ,
Col Mean( :"Amount of Cyanidin (ng/kg)"n, :Sample Number )
)
The If() clause is interpreted as: if the current value of "Sample Number" is not equal to the value of "Sample Number" in the row 1 row beyond the current row( Row() + 1 ), then do the calculation. If this comparison is not true, then it does nothing.
So this works great except for the last row in the data table. When JMP attempts to look at a row 1 row beyond the last row in the data table, it has no row to compare with, so it can not make a decision.
Thus, the formula needs to take into account this issue too.
If( :Sample Number != :Sample Number[Row() + 1] | Row() == N Rows( Current Data Table() ),
Col Mean( :"Amount of Cyanidin (ng/kg)"n, :Sample Number )
)
Here the additional clause is checking to see if the current row ,Row() , is equal to the number of rows in the data table, N Rows( Current data Table(). The second clause is separated by "|" which indicates that if either the first clause "OR" the second clause is true then process the calculation.
The second formula column follows the same logic with just the By column being changed to "Developmental Stage".
Concerning what needs to change to be able to use this on your full data table. I do not know what you are referring to when you say, "cultivar". The requirements for the formulas to work properly are for the data to be sorted in order of the "Developmental Stage" and "Sample Number" and that "Amount of Cyanidin (ng/kg)" is the name of the column that the means are calculated on. If any of those columns have a change in name, then the new names need to be swapped out in the formulae.
Jim