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

Excelで条件付きのフィルタリングされたデータ/リストをカウントする方法は?

テーブルをフィルタリングしたかどうかに関係なく、COUNTIF関数はフィルタリングを無視して固定値を返すことに気付くかもしれません。 場合によっては、特定の基準でフィルタリングされたデータをカウントする必要がありますが、それを行うにはどうすればよいですか? この記事では、Excelでフィルター処理されたデータ/リストをCountifする方法をいくつか紹介します。


Excel でヘルパー列を追加することにより、Countif フィルター処理されたデータを基準にします。

この記事では、次の表を例に取り上げます。 ここでは、Salesman 列で Julie と Nicole を除外しています。

元のデータ:

フィルタリングされたデータ:

この方法では、追加のヘルパー列を追加することができます。その後、COUNTIFS 関数を適用して、フィルター処理されたデータを Excel でカウントできます。 (Note注: この方法では、以下の手順を実行する前に、元のテーブルをフィルター処理する必要があります)。

1. 元のフィルター処理されたテーブル以外の空白のセルを見つけます (セル G2 など)、次のように入力します。 = IF(B2 = "Pear"、1、 "")、次にフィルハンドルを必要な範囲にドラッグします。 ((注: 式では = IF(B2 = "Pear"、1、 "")、B2はカウントするセルであり、「Pear」はカウントする基準です。)

元のフィルター処理されたテーブルに加えて、ヘルパー列が追加されました。 「1」は B 列のナシであることを示し、空白は B 列のナシではないことを示します。

2。 空白のセルを見つけて、数式を入力します =COUNTIFS(B2:B18,"Pear",G2:G18,"1")、を押して 入力します キー。 ((注: 式では =COUNTIFS(B2:B18,"Pear",G2:G18,"1")、B2:B18とG2:G18はカウントする範囲であり、「Pear」と「1」はカウントする基準です。)

これで、カウント数がすぐに取得できます。 カウント数にご注意ください 変わらない フィルタリングを無効にするか、フィルタリングを変更した場合。

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

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


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

Excel関数による基準でフィルタリングされたデータをCountif

フィルタの変更に応じてカウント数を変更する場合は、次のようにExcelでSUMPRODUCT関数を適用できます。
空白のセルに数式を入力します =SUMPRODUCT(SUBTOTAL(3,OFFSET(B2:B18,ROW(B2:B18)-MIN(ROW(B2:B18)),,1)),ISNUMBER(SEARCH("Pear",B2:B18))+0)、を押して 入力します キー。

ノートリボン 数式は複雑すぎて覚えられませんか? 数式を定型句として保存して、後でワンクリックで再利用できるようにします。
続きを読む...     無料体験

注意:
(1)上記の式で、B2:B18はカウントする範囲であり、「Pear」はカウントする基準です。
(2) 戻り値 変更されます フィルタリングまたはフィルタリングの変更を無効にした場合。

Excelの列の条件に基づいて、範囲を複数のシートに簡単に分割します

複雑な配列数式と比較すると、フィルタリングされたすべてのレコードを新しいワークシートに保存してから、Count関数を適用してフィルタリングされたデータ範囲またはリストをカウントする方がはるかに簡単な場合があります。

Excel用のKutools 分割データ ユーティリティは、Excelユーザーが元の範囲のXNUMX列の基準に基づいて範囲を複数のワークシートに簡単に分割するのに役立ちます。


広告分割データ0


関連記事

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

🤖 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 (17)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
When i change the filter, the count will change automatically ?
This comment was minimized by the moderator on the site
Is there a way to modify the formula for filtered data if I'm wanting to gather the information but for both pears and oranges?
This comment was minimized by the moderator on the site
Hi there,

With the first method, you can enter the following formula in the helper column: =IF(B2="Pear",1,IF(B2="Orange",1,"")
And then use the following formula to get the total count: =COUNTIFS(G2:G18,1)

Amanda
This comment was minimized by the moderator on the site
Sweet, this works!
This comment was minimized by the moderator on the site
hey i want to count value greater than 1 but with filtered visible data, can you help?
This comment was minimized by the moderator on the site
Hi,
I need help calculating the percentage of PP students (column F) with SEN (column E) who have s or b (column G)

Here's the formula I've been trying to use but it's not working.

Any help/advice appreciated.

=SUMPRODUCT(ISNUMBER(MATCH($E$2:$E$30,{"<>"},0))*ISNUMBER(MATCH($F$2:$F$30,{"<>"},0))*ISNUMBER(MATCH($T$2:$T$30,{"s","b"},0)))/SUMPRODUCT(ISNUMBER(MATCH($E$2:$E$30,{"<>"},0))*ISNUMBER(MATCH($F$2:$F$30,{"<>"},0)))

Claire
This comment was minimized by the moderator on the site
How about if “pear” needs to be a number value “<0” what do you use instead of (search?
This comment was minimized by the moderator on the site
Hi Sib,
You can apply the COUNTIFS functions to count items with two or more criteria. In the case of this webpage, you can use the formulas =COUNTIFS(B2:B21,"Pear",C2:C21,"<0") to count the pears whose amount is less than 0.
However, the count result is solid and won’t change when you change the filter.
This comment was minimized by the moderator on the site
Thanks a lot. It's really excellent! Thanks once a lot.
This comment was minimized by the moderator on the site
Excellent!!! Now able to filter and countif based on creiteria.
This comment was minimized by the moderator on the site
How would I add another criteria to the filtered data formula?
This comment was minimized by the moderator on the site
Hi Kane,
Which kind of filter criteria do you want to add? More detailed information can help we understand and solve your problem quicker.
This comment was minimized by the moderator on the site
Same with my question. How to count filtered if there are two criteria "Pear" for fruit and "Julie" for salesman?

Thanks.
This comment was minimized by the moderator on the site
Hi,
In this situation, I guess a helper column I introduced in the first method may be easier to count.
This comment was minimized by the moderator on the site
AWESOME, I used the formula, and it was exactly what I need. thanks!!
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