Excel のピボットテーブルが合計ではなくデータの個数になる

値フィールドをクリックし、Excel では「値フィールドの設定」で集計を合計に、Google Sheets では Values の Summarize by を SUM にします。元列の空白、n/a、文字列の数値が原因でデータの個数になることが多いです。元データを直してから更新するか、フィールドを外してやり直してください。

目次

要点

値フィールドをクリックし、Excel では「値フィールドの設定」で集計を合計に、Google Sheets では Values の Summarize by を SUM にします。元列の空白、n/a、文字列の数値が原因でデータの個数になることが多いです。元データを直してから更新するか、フィールドを外してやり直してください。

=COUNT(L1:L3)
=COUNTA(L1:L3)
=SUM(L1:L3)

確認のポイント

8行の売上では合計は 24450、東は 9450、データの個数は 8 です。2026年11月12日に 4800、3000、文字列 n/a の3セルを調べると、COUNT は 2、COUNTA は 3、SUM は 7800 で、文字列は無視されました。=SUM(F2:F9) でピボットと照合し、個数フィールドを通貨書式にするだけでは直りません。

注意点と互換性

メニューにデータの個数しかない場合、フィールドが文字列扱いです。先に数値へ変換してから追加し直します。見出しや先頭行のメモも原因になります。直ったあとは「売上の合計」のように表示され、「売上の個数」のままではいけません。

英語の詳細例・数式・著者メモ

Tested in: COUNT, COUNTA and SUM on a mixed range, and the eight-row sales totals, were evaluated in Google Sheets on 12 November 2026. Excel 365 menu names are the current desktop labels; I did not click through Value Field Settings in Excel this session.

If you do not have a pivot yet, start with How to Create a Pivot Table in Excel. If the totals are stale rather than counted, see pivot table not refreshing.

What a Count total looks like

On the eight-sale sample used elsewhere on this site, a Sum of Revenue is 24450, and East is 9450. A Count of the same field is 8 — one per row. If your “grand total” is a small whole number that matches the number of records, you are looking at a count, not at money.

In Google Sheets on 12 November 2026 I put 4800, 3000 and the text n/a in a three-cell range:

=COUNT(L1:L3)
=COUNTA(L1:L3)
=SUM(L1:L3)

Those returned 2, 3, and 7800. COUNT sees only the two numbers. COUNTA sees all three cells. SUM over the range added the two numbers and skipped the text, which is what you want for a revenue total — but a pivot that sniffed the text in that column may still have placed the field in Values as Count.

(If you write =SUM(4800,3000,"n/a") with the text as an argument rather than a cell, Google Sheets returns #VALUE!. The range form is the one that matches a source column.)

How to switch the field to Sum

In Excel 365

  1. Click any number in the Values area, or click the field in the Values well.
  2. Open Value Field Settings (from the field’s menu, or by right-clicking a value cell and choosing Value Field Settings).
  3. Under Summarize value field by, choose Sum.
  4. Click OK. The caption should change from “Count of Revenue” to “Sum of Revenue.”

In Google Sheets

  1. Click the pivot to open the editor.
  2. In Values, find the field.
  3. Set Summarize by to SUM.

If the menu offers only Count, the field is being treated as text. Convert the source column to numbers first, then re-add the field; see convert text to numbers.

Clean the source so it stays on Sum

Look down the Revenue column (or whatever you are summing) for blanks, apostrophes in front of numbers, spaces, currency symbols that were pasted as text, and placeholders such as n/a or -. Replace placeholders with a real 0 if zero is the right amount, or leave the cell empty only if that row should not be in the list. Then refresh the pivot, or remove the field from Values and drag it back in.

A header that Excel misreads, or a leftover note in the first data row, can also push the field into Count. Keep a single header row and numbers only underneath.

Once Values says Sum, check it against the sheet: =SUM(F2:F9) should be 24450 on the sample, and =SUMIFS(F2:F9,B2:B9,"East") should be 9450. If the pivot is still at 8, you changed the wrong field, or a filter is hiding rows, or you are still on Count.

Do not format a Count as currency and hope it will start adding. The summary function, not the number format, decides whether the pivot counts or sums.

Oscar

表計算の数式とトラブル解決を紹介。検証環境と未確認事項は各記事を参照。

Tested in Google Sheets (via Sheets API) on 12 November 2026: COUNT, COUNTA and SUM on a three-cell range of 4800, 3000 and the text n/a, plus the eight-row sales totals (East 9450, grand 24450) used as a check. Excel 365 menu names are the current desktop labels; I did not click through the Value Field Settings dialog in Excel this session..

次の記事:検索と条件付き集計 Excel のピボットテーブルに計算フィールドを追加する