cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
jasongao
Level II

How to get a average for part of column data by using formula

For example, I have a column:

2

3

4

50

60

70

would like to get the average for every 3 rows, and put the average in a new column in first row in every set by using formua, like this: 

2  3

3

4

50  60

60

70

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ms
Super User (Alumni) ms
Super User (Alumni)

Re: How to get a average for part of column data by using formula

Try this:

If(Modulo(Row(), 3) == 1,
    Col Mean(:Column 1, Ceiling(Row() / 3))
)

View solution in original post

3 REPLIES 3
uday_guntupalli
Level VIII

Re: How to get a average for part of column data by using formula

@jasongao
     One way would be something like this: 

     You will need to extract your data from column into a matrix. You can do that using << get as matrix command. 

Mat = [2,3,4,50,60,70] ; 

NewMat = Transpose(Shape(Mat,(N Rows(Mat) * N Cols(Mat))/3,3 )); 

V Mean((NewMat)); 
Best
Uday
ms
Super User (Alumni) ms
Super User (Alumni)

Re: How to get a average for part of column data by using formula

Try this:

If(Modulo(Row(), 3) == 1,
    Col Mean(:Column 1, Ceiling(Row() / 3))
)
jasongao
Level II

Re: How to get a average for part of column data by using formula

Thanks! It works!