cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
BHarris
Level VI

JMP equivalent of Excel's SUMPRODUCT function

Is there a JMP equivalent of Excel's SUMPRODUCT function?

 

E.g., suppose I have a table like this:

 

RowSetRunProbabilityValueWeighted Value
1A10.27.5 
2A20.814.2 
3B10.3518.1 
4B20.6525.9 

 

... I would like to add a function to the "Weighted Value" column that would populate Rows 1 and 2 with (0.2*7.5+0.8*14.2), and Rows 3 and 4 with (0.35*18.1+0.65*25.9).

 

I imagine it would look something like:  SUMPRODUCT( { :Probability, :Value }, :Set )   ... where :Probability and :Value are the columns to be multiplied, then added, grouping on :Set.  But obviously that's not a function in JMP -- is there something similar?

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: JMP equivalent of Excel's SUMPRODUCT function

Your guess was close.

Col Sum( :Probability * :Value, :Set )
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: JMP equivalent of Excel's SUMPRODUCT function

Your guess was close.

Col Sum( :Probability * :Value, :Set )
Jim
Craige_Hales
Super User

Re: JMP equivalent of Excel's SUMPRODUCT function

@shannon_conners, @julian   -  the doc and scripting index should capture some of these excel translations. This one should have an explanation like

you can use any expression for the first parameter. For example, you can use 1 to count how many by-values, or a product of two columns. Or just a single column. Whatever it is, it will be added up until the by-value changes. The excel SumProduct function becomes ...

By including the relevant words, people can look it up. The doc was not clear that the first parameter did not need to be a simple column name (five examples, all use :height for the first parameter).

Craige