メインコンテンツへスキップ

Excelでフィルター処理されたセルまたは表示されているセルのみを合計するにはどうすればよいですか?

Excelで数値の列を合計するのは簡単かもしれませんが、基準を満たすために一部のデータをフィルタリングまたは非表示にする必要がある場合があります。 非表示またはフィルタリングした後、フィルタリングされた値または表示された値のみを合計する必要があります。 Excelで合計関数を適用すると、非表示のデータを含むすべての値が追加されます。この場合、Excelでフィルター処理されたセル値または表示されたセル値のみを合計するにはどうすればよいですか。


数式を使用して、フィルタリングされたセル値または表示されているセル値のみを合計します

これに 小計 フィルタによって除外された行を無視する関数を使用すると、表示されているセルのみを簡単に合計できます。 あなたはこれを行うことができます:

ある範囲のデータがあり、それらが必要に応じてフィルタリングされていると仮定すると、スクリーンショットを参照してください。

1。 空白のセル(たとえばC13)に、次の数式を入力します。 =小計(109、C2:C12) (109 数値を合計すると、非表示の値が無視されることを示します。 C2:C12 は、フィルタリングされた行を無視して合計する範囲です。)、を押します。 入力します キー。

注: この数式は、ワークシートに非表示の行がある場合に、表示されているセルのみを合計するのにも役立ちます。 ただし、この数式は、非表示の列のセルを無視して合計することはできません。

非表示またはフィルタリングされたセル/行/列を無視して、指定された範囲内の表示セルの合計/カウント/平均

通常、SUM /カウント/平均関数は、セルが非表示/フィルタリングされているかどうかに関係なく、指定された範囲内のすべてのセルをカウントします。 小計関数は、非表示の行を無視して合計/カウント/平均することしかできません。 ただし、Kutools for Excel 可聴 / 数え切れない / 平均的に見える 関数は、非表示のセル、行、または列を無視して、指定された範囲を簡単に計算します。


広告合計数平均可視セルのみ

ユーザー定義関数を使用して、フィルター処理されたセル値または表示されているセル値のみを合計します

次のコードに興味がある場合は、表示されているセルのみを合計するのにも役立ちます。

1。 を押し続けます Alt + F11 キー、そしてそれは開きます アプリケーション向け Microsoft Visual Basic 窓。

2に設定します。 OK をクリックします。 インセット > モジュール、モジュールウィンドウに次のコードを貼り付けます。

Function SumVisible(WorkRng As Range) As Double
'Update 20130907
Dim rng As Range
Dim total As Double
For Each rng In WorkRng
    If rng.Rows.Hidden = False And rng.Columns.Hidden = False Then
        total = total + rng.Value
    End If
Next
SumVisible = total
End Function

3。 このコードを保存して、数式を入力します = SumVisible(C2:C12) 空白のセルに。 スクリーンショットを参照してください:

4。 次に、 入力します キーを押すと、希望する結果が得られます。


合計/カウント/平均は、Kutools forExcelでフィルタリングされたセルまたは表示されたセルのみ

Kutools for Excelがインストールされている場合は、Excelで表示または除外されたセルのみの合計/カウント/平均を簡単にすばやく計算できます。

Kutools for Excel - 300 以上の必須ツールで Excel を強化します。 クレジット カードは必要なく、全機能を備えた 30 日間の無料トライアルをお楽しみください。 今すぐ入手

たとえば、表示されているセルのみを合計する場合は、合計結果を配置するセルを選択し、数式を入力してください = SUMVISIBLE(C3:C12) (C3:C13は、表示されているセルのみを合計する範囲です)を入力し、を押します。 入力します キー。

そして、すべての非表示セルを無視して合計結果が計算されます。 スクリーンショットを参照してください:

目に見える細胞のみをカウントするには、この式を適用してください = COUNTVISIBLE(C3:C12); 可視セルのみを平均化するには、この式を適用してください = AVERAGEVISIBLE(C3:C12).

注: 数式を正確に思い出せない場合は、以下の手順に従って、表示されているセルのみを簡単に合計/カウント/平均化できます。

1.合計結果を配置するセルを選択し、をクリックします クツール > 機能 > 統計と数学 > 可聴 (または 平均的に見える, 数え切れない 必要に応じて)。 スクリーンショットを参照してください:

2. [関数の引数]ダイアログボックスを開いて、非表示のセルを無視して合計する範囲を指定し、[ OK ボタン。 スクリーンショットを参照してください:

Kutools for Excel - 300 以上の必須ツールで Excel を強化します。 クレジット カードは必要なく、全機能を備えた 30 日間の無料トライアルをお楽しみください。 今すぐ入手

そして、すべての非表示セルを無視して合計結果が計算されます。


デモ:合計/カウント/平均はフィルタリングされたセルまたは表示されたセルのみ


Kutools for Excel: 300 を超える便利なツールをすぐに利用できます。 機能制限なしの 30 日間の無料トライアルを今すぐ始めてください。 今すぐダウンロード!

Excelで非表示の行を削除することにより、フィルターで除外された/表示されているセルのみを簡単に合計/カウントします

Excelでフィルターで除外されたセルを合計/カウントする場合、SUM関数またはCount関数は非表示のセルを無視しません。 非表示/フィルタリングされた行が削除された場合、表示されているセルを簡単に合計またはカウントすることしかできません。 あなたはExcelのためにKutoolsを試すことができます 非表示の(表示されている)行と列を削除する それを解決するためのユーティリティ。


ad削除隠し行列3

関連記事:

最高のオフィス生産性向上ツール

🤖 Kutools AI アシスタント: 以下に基づいてデータ分析に革命をもたらします。 インテリジェントな実行   |  コードを生成  |  カスタム数式の作成  |  データを分析してグラフを生成する  |  Kutools関数を呼び出す...
人気の機能: 重複を検索、強調表示、または識別する   |  空白行を削除する   |  データを失わずに列またはセルを結合する   |   数式なしのラウンド ...
スーパールックアップ: 複数の基準の VLookup    複数の値の VLookup  |   複数のシートにわたる VLookup   |   ファジールックアップ ....
詳細ドロップダウン リスト: ドロップダウンリストを素早く作成する   |  依存関係のドロップダウン リスト   |  複数選択のドロップダウンリスト ....
列マネージャー: 特定の数の列を追加する  |  列の移動  |  Toggle 非表示列の表示ステータス  |  範囲と列の比較 ...
注目の機能: グリッドフォーカス   |  デザインビュー   |   ビッグフォーミュラバー    ワークブックとシートマネージャー   |  リソースライブラリ (自動テキスト)   |  日付ピッカー   |  ワークシートを組み合わせる   |  セルの暗号化/復号化    リストごとにメールを送信する   |  スーパーフィルター   |   特殊フィルター (太字/斜体/取り消し線をフィルター...) ...
上位 15 のツールセット12 テキスト ツール (テキストを追加, 文字を削除する、...)   |   50+ チャート 種類 (ガントチャート、...)   |   40+ 実用的 (誕生日に基づいて年齢を計算する、...)   |   19 挿入 ツール (QRコードを挿入, パスから画像を挿入、...)   |   12 変換 ツール (数字から言葉へ, 通貨の換算、...)   |   7 マージ&スプリット ツール (高度な結合行, 分割セル、...)   |   ... もっと

Kutools for Excel で Excel スキルを強化し、これまでにない効率を体験してください。 Kutools for Excelは、生産性を向上させ、時間を節約するための300以上の高度な機能を提供します。  最も必要な機能を入手するにはここをクリックしてください...

説明


Officeタブは、タブ付きのインターフェイスをOfficeにもたらし、作​​業をはるかに簡単にします

  • Word、Excel、PowerPointでタブ付きの編集と読み取りを有効にする、パブリッシャー、アクセス、Visioおよびプロジェクト。
  • 新しいウィンドウではなく、同じウィンドウの新しいタブで複数のドキュメントを開いて作成します。
  • 生産性を 50% 向上させ、毎日何百回もマウス クリックを減らすことができます!
Comments (26)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Bonjour,
Moi j'ai un problème comparable mais différent, en gros quand je filtre mes colonnes et que je veux copier la même valeur dans mes lignes visibles, toute les lignes qui sont entre mes lignes visibles sont elles aussi modifiées.
Comment faire pour que seule mes lignes visibles soient modifiés.
This comment was minimized by the moderator on the site
Hello, Loux

Do you mean to copy and paste cell vaues to visible cells only? If so, maybe the below articles can help you:
https://www.extendoffice.com/documents/excel/2331-excel-paste-data-into-filtered-list.html
https://www.extendoffice.com/documents/excel/2617-excel-paste-to-visible-filtered-cells.html

Please try it, thank you!
This comment was minimized by the moderator on the site
Hola,

No me resulta sumar el rango de una fila considerando sólo las columnas visibles.

Alguna formula o alguna macro?

Gracias!!!
This comment was minimized by the moderator on the site
Hello, Cristobal,
Sorry, I can't understand your problem clearly, could you explain your problem in English?
Or you can insert a screenshot or a file to describe your problem.
Thank you!
This comment was minimized by the moderator on the site
Hola,

Quiero sumar dentro de un rango de fila que al ocultar columnas sume sólo las visibles.
No he logrado hacerlo, alguna fórmula? o tendría que hacerse con una marcro?

Muchas gracias!!!
This comment was minimized by the moderator on the site
how to skip hidden cells from excel formulae in filtered sheet....

yellow coloured cells are involving hidden cells due to filter....
This comment was minimized by the moderator on the site
Hi,
What kinds of calculation do you need to do? Kutools for Excel supports three functions to count/sum/average ignoring all hidden cells.
This comment was minimized by the moderator on the site
or like this



column a column d

100 10

90 10

80 10



where 90=100-10, 80=90-10, and so on.........

dragging the formula includes hidden cells in formula
This comment was minimized by the moderator on the site
When i am applying say G3-K2 Formula in filtered excel sheet & dragging the formula, it includes hidden cells

for example



Validity Lifting Qty
27054.59 123.41
26931.18 330.98
26600.20 493.66
26106.54 476.38
25630.16 480.64
25149.52 577.06


now value in validity comes after get subtracted by lifted qty (like 2nd value 26931.18=27054.59-123.41)

3rd value in validity=2nd value in validity-2nd value in lifted qty. and so on.....

now this sheet is filtered & when i drag the formulae in validity column, it includes hidden cells, due to filter.

which gives me wrong result
This comment was minimized by the moderator on the site
Validity Lifting Qty
27054.59 123.41
26931.18 330.98
26600.20 (26600.2=26931.18-330.98) 493.66
26106.54 476.38
25630.16 480.64
25149.52 577.06
This comment was minimized by the moderator on the site
When i am applying say G3-K2 Formula in filtered excel sheet & dragging the formula, it includes hidden cells

for example



Validity Lifting Qty
27054.59 123.41
26931.18 330.98
26600.20 493.66
26106.54 476.38
25630.16 480.64
25149.52 577.06


now value in validity comes after get subtracted by lifted qty (like 2nd value 26931.18=27054.59-123.41)

3rd value in validity=2nd value in validity-2nd value in lifted qty. and so on.....

now this sheet is filtered & when i drag the formulae in validity column, it includes hidden cells, due to filter.

which gives me wrong result
This comment was minimized by the moderator on the site
Hi,
The normal =G3-K2 will not ignore any hidden cells/rows/column by dragging to copy. I am sorry I can not figure out a proper formula for your. All formulas or methods talked in this article is just about sum/count/average ignoring hidden cells.
This comment was minimized by the moderator on the site
how i can skip hidden cells from excel formulae in filtered sheet
This comment was minimized by the moderator on the site
Im trying to use the AVERAGEVISIBLE function to average the 12 largest values in a column, this works in the normal AVERAGE function as =AVERAGE(LARGE(E971:E1540,{1,2,3,4,5,6,7,8,9,10,11,12})) however when i try to use the average visible function it returns #VALUE!, any ideas?
This comment was minimized by the moderator on the site
This is awesome! Thanks so much.
This comment was minimized by the moderator on the site
Sorry I messed up the posts security code at bottom and seems like my question may have been deleted as it asked me to try another one. I can get the VBA code for SUMVISIBLE to work well if my data is vertical and I hide rows. However it doesn't if my data runs horizontal and I want to hide columns. Is there a way to program this? Thanks!
This comment was minimized by the moderator on the site
I am able to get your VBA for =SUMVISIBLE above to work good. However just if my data runs vertically and I am hiding rows. Is there a way to program it so you can have your data run horizontally and it still work when you hide columns? THANKS!
This comment was minimized by the moderator on the site
The solution worked for me. :D
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations