Automatically translated.View original post

This is the correct answer ‼️ subtotal total

\ Do not use the SUM function anymore! /

When summing a table with subtotals,

Are you not selecting a range with the SUM function?

Actually it,

i added up the subtotal together.

It may be double counting...

That's when the SUBTOTAL function comes in!

=====================

👉 solution

[How to put out the subtotal]

① In the cell you want to put out a subtotal

= Enter SUBTOTAL (9, range)

② Aggregation method is 9 (SUM)

③ Select only the data range you want to subtotal

[How to put out the total]

What you do is the same as a subtotal.

The only difference is the range of choices.

Enter SUBTOTAL (9, range),

Simply select the range that includes the subtotal as it is.

The subtotal created with the SUBTOTAL function

Since it is automatically excluded from the calculation,

It will not be a double calculation ◎

=====================

Make your job easier!

Introducing Excel techniques that you can learn in 1 minute ✏️

To a full-time mom who is busy every day,

Change free time to important time with children ✨

# Excel # beginner # efficiency # short time # work

2/13 Edited to

... Read more私も以前、請求書っぽい表(数量・単価・合計金額が並んでて、途中に「小計」、最後に「合計」がある形)をSUMで集計して、合計がなぜか大きくなって焦りました。原因はシンプルで、途中の「小計」行まで一緒に足していた=二重計算でした。 こういう「小計を含む表」の集計は、SUMよりSUBTOTALが安全です。基本は記事内のとおりで、 ・小計:=SUBTOTAL(9,小計したい明細範囲) ・合計:=SUBTOTAL(9,小計も含めた全体範囲) だけ。SUBTOTALで作った小計セルは、同じくSUBTOTALで合計すると自動的に除外されるので、合計がブレません。 さらにミスを減らすために、私がやっているコツを補足します。 1) 「小計」と「合計」の違いを意識する 小計=カテゴリごとの途中集計、合計=全体の最終集計。SUMだと“途中集計セルも数値”として扱われるので、表の構造上ミスりやすいです。SUBTOTALは「集計用の数式セルを合計から外す」動きをしてくれるのが強み。 2) フィルターを使う表なら、集計方法の番号も確認 9はSUM(合計)ですが、SUBTOTALはフィルターで非表示になった行を集計から外す挙動もあります。普段フィルターで絞り込みながら「合計金額」を確認する運用なら、SUBTOTALにしておくと集計が安定します。 3) 範囲選択は“明細列だけ”に絞る 「合計金額」列だけを指定する、など集計対象を明確にすると、あとから列が増えても崩れにくいです。小計行・合計行を含めてOKなのは“合計側のSUBTOTAL”だけ、と覚えると迷いません。 4) 値引きの自動計算も一緒に作ると実務が楽 値引きがある場合は、明細に「値引き後金額」列を作ってから集計すると分かりやすいです。例: ・値引き率(例:10%)があるなら:=数量*単価*(1-値引き率) ・値引き額(例:500円引き)なら:=数量*単価-値引き額 そして小計・合計は、その「値引き後金額」列にSUBTOTAL(9,範囲)を使うと、算出の流れが一本化します。 5) 大きな数値が「7.26E+…」みたいな科学的記数法になったとき 集計中に桁が大きいと表示が変わって不安になります。これは計算ミスではなく表示形式の問題が多いです。 ・セルの表示形式を「数値」や「標準」→「数値(小数点以下0)」に変更 ・列幅を広げる これで通常の桁表示に戻せます。 小計入りの表は「構造が分かりやすい反面、集計はミスりやすい」ので、最初からSUBTOTAL前提で作るのがいちばん安心でした。