Origin scripting can be very useful, but I’ve never really got to grips with it.

To avoid having to use many different menus to manipulate workbooks, you can use ‘**Before formula scripts**‘ when you set column values.

It took me a while to find **a good guide on this**, but this is what i was looking for:

http://www.originlab.com/index.aspx?go=Products/Origin/DataAnalysis/Mathematics/SimpleMathematics

# Origin scripting – calculating the mean

As a quick example, let’s calculate the mean of a column of data in origin.

I’ll start with a simple table of data in columns a and b:

Here I’ve added the mean as a constant value in column c. To do this I right clicked on column C to ‘set values as’. Into the resulting dialogue box I type this:

Graphically, what we have done is this: