Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- How to get a average for part of column data by using formula

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jan 8, 2019 2:17 PM
(979 views)

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Try this:

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

3 REPLIES 3

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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

Uday

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Try this:

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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

Thanks! It works!