T O P I C R E V I E W |
olsy |
Posted - 09/19/2011 : 09:06:21 AM Origin Ver. and Service Release (Select Help-->About Origin): 8.5Pro Operating System:Win7
Hi guys! Got a problem: i have a several worksheets in one workbook and number of worksheets can be different. So i need to find a mean value and standard deviation for columns 5-10 in worksheets starting from second and finish before two last...and put results to a specified column in last worksheet.
Who has any idea? |
3 L A T E S T R E P L I E S (Newest First) |
Penn |
Posted - 09/21/2011 : 9:21:38 PM Hi,
Please focus on step 3, 4, and 5. Also, an example, which I have told in this thread before, can be referred to. If you want to combine columns from 5 to 10 as one dataset to calculating mean and standard deviation, you can refer to the vector class to handle the vectors derived from step 3.
Penn |
olsy |
Posted - 09/21/2011 : 11:55:30 AM Thanks Penn! I manage to figure out how to loop over worksheets but now i donīt understand how to select columns from 5 till 10 and make basic statistics for each of them...it is confusing me. iīve tried SetRange but it is wrong i guess.
How does it work? |
Penn |
Posted - 09/20/2011 : 03:03:41 AM Hi,
Maybe you can refer to the following steps:
1. Get the workbook, you can use the WorksheetPage constructor by passing workbook name.
2. Loop all layers contained in the workbook by Layers collection. Then create the worksheet by passing the layer to the Worksheet constructor. You can use the foreach statement.
3. Get Columns collection from worksheet, and then get column data by GetDataObject method. The result vector contains the data for calculating the mean and standard deviation.
4. Calculate the mean and standard deviation by using ocmath_basic_summary_stats function.
5. Put the results to worksheet by SetCells method.
Hope the steps help.
Penn |