数式項目の戻り値のデータ型を「テキスト」に設定し、TEXT() 関数を用いて通貨型の項目を参照すると、通貨型項目が元々持っていた桁区切り(,)が表示されなくなります。
TEXT() 関数でテキスト型に変換した数値に対し、CASE() 関数や LEN() 関数などを組み合わせて桁区切りのカンマを意図的に追加します。
カンマを挿入する数式サンプル
以下の数式例は、数値が最大10桁であることを想定しています。数式内の「*」を、対象の通貨項目の API 参照名に置き換えてご利用ください。
数式例:
CASE(LEN( TEXT(*) ) ,
4, LEFT( TEXT(*), 1) & "," & RIGHT( TEXT(*), 3),
5, LEFT( TEXT(*), 2) & "," & RIGHT( TEXT(*), 3),
6, LEFT( TEXT(*), 3) & "," & RIGHT( TEXT(*), 3),
7, LEFT( TEXT(*), 1) & "," & MID( TEXT(*), 2, 3) & "," & RIGHT( TEXT(*), 3) ,
8, LEFT( TEXT(*), 2) & "," & MID( TEXT(*), 3, 3) & "," & RIGHT( TEXT(*), 3),
9, LEFT( TEXT(*), 3) & "," & MID( TEXT(*), 4, 3) & "," & RIGHT( TEXT(*), 3),
10, LEFT( TEXT(*), 1) & "," & MID( TEXT(*), 2, 3) & "," &MID( TEXT(*), 5, 3) & "," & RIGHT( TEXT(*), 3),
TEXT(*))
数式の解説:
この数式は、CASE() 関数を用いて数値の桁数に応じた処理を分岐させています。
LEN(TEXT(*)) で通貨項目「*」の桁数を判定する。
もし 4 桁であった場合(例:1000)は、LEFT(TEXT(*), 1) で左から1文字目(「1」)を取得し、次に , を連結し、RIGHT(TEXT(*), 3) で右から3文字(「000」)を取得して連結する(結果:1,000)。
5桁以上の数値についても同様のロジックで、MID() 関数などを活用しながらカンマを挿入する位置を調整している。
なお、数式のサポート範囲や詳細については、「数式のサポート範囲」を合わせて参照してください。
005132555

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.