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

- JMP User Community
- :
- Discussions
- :
- How do I sum multiple columns using the formula window?

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

Highlighted

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

May 21, 2015 12:10 PM
(16233 views)

I have a table with 100 or more columns and would like to easily sum them in another column. Best way to do so without making a formula A + B + C.....100 times

2 ACCEPTED SOLUTIONS

Accepted Solutions

Highlighted

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

If a dynamic formula is not crucial, the jsl script below should add a new static column with the row-wise sum of every numeric column in the data table.

dt = Current Data Table**()**;

dt << **New Column****(**"sum", numeric, values**(**V Sum**((**dt << **get as matrix****)**`**)))**;

Highlighted

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

Created:
May 21, 2015 2:14 PM
| Last Modified: Oct 18, 2016 4:21 PM
(20996 views)
| Posted in reply to message from tarpon17 05-21-2015

You can also do this within the formula editor using the Sum() function.

Fill in the argument for the function by clicking on the first column that you want to sum, and then shift-click on the last.

-Jeff

-Jeff

2 REPLIES 2

Highlighted

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

If a dynamic formula is not crucial, the jsl script below should add a new static column with the row-wise sum of every numeric column in the data table.

dt = Current Data Table**()**;

dt << **New Column****(**"sum", numeric, values**(**V Sum**((**dt << **get as matrix****)**`**)))**;

Highlighted

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

Created:
May 21, 2015 2:14 PM
| Last Modified: Oct 18, 2016 4:21 PM
(20997 views)
| Posted in reply to message from tarpon17 05-21-2015

You can also do this within the formula editor using the Sum() function.

Fill in the argument for the function by clicking on the first column that you want to sum, and then shift-click on the last.

-Jeff

-Jeff

Article Labels

There are no labels assigned to this post.