日本語 English
株式会社ヒューリンクス
TEL:03-5642-8384
営業時間:9:00-17:30

sum

関数 sum は、リスト順に累積和を計算し、対応する数値範囲を返します。値が順に累積的に加算されていきます。

範囲の最初の数値には加算する数値がありませんので、結果の最初の数値は常に配列の最初の数値と等しくなります。

構文

sum(range)

引数 range には 1つの範囲 ({} で指定) 、もしくは、ワークシートの1列を指定します。範囲内に欠損値や文字列が含まれている場合は欠損値または文字列として返されます。

  • x = {2,6,7} に対して、sum(x){2,8,15} を返します。
  • y = {4,12,-6} に対して、sum(y){4,16,10} を返します。

関連情報

sum

The function sum returns a range of numbers representing the accumulated sums along the list. The value of the number is added to the value of the preceding cumulative sum.

Because there is no preceding number for the first number in a range, the value of the first number in the result is always the same as the first number in the argument range.

Syntax

sum(range)

The range argument must be a single range (indicated with the { } brackets) or a worksheet column. Any text string or missing value contained within the range is returned as the string or missing value.

Example

For x = {2,6,7}, the operation sum(x) returns a value of {2,8,15}.

For y = {4,12,-6}, the operation sum(y) returns a value of {4,16,10}.

関連情報