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

Excelの別の列に基づいて一意の値をカウントするにはどうすればよいですか?

基準1で一意のドキュメント数

XNUMXつの列だけで一意の値をカウントするのが一般的かもしれませんが、この記事では、別の列に基づいて一意の値をカウントする方法について説明します。 たとえば、次のXNUMXつの列のデータがあります。次の結果を得るには、列Aの内容に基づいて列Bの一意の名前をカウントする必要があります。

配列数式を使用して別の列に基づいて一意の値をカウントします


矢印青い右バブル 配列数式を使用して別の列に基づいて一意の値をカウントします

この問題を解決するには、次の式が役立ちます。次のようにしてください。

1。 次の式を入力します。 =SUMPRODUCT((($A$2:$A$18=D2))/COUNTIFS($A$2:$A$18,$A$2:$A$18&"",$B$2:$B$18,$B$2:$B$18&"")) 結果を入れたい空白のセルに、 E2、 例えば。 そしてを押します Ctrl + Shift + Enter 正しい結果を得るために一緒にキーを押します。スクリーンショットを参照してください。

基準2で一意のドキュメント数

Note:上記の式では: A2:A18 は、に基づいて一意の値をカウントする列データです。 B2:B18 一意の値をカウントする列です。 D2 一意にカウントする基準が含まれています。

2。 次に、塗りつぶしハンドルを下にドラッグして、対応する基準の一意の値を取得します。 スクリーンショットを参照してください:

基準3で一意のドキュメント数


関連記事:

Excelで範囲内の一意の値の数を数える方法は?

Excelでフィルタリングされた列の一意の値をカウントするにはどうすればよいですか?

列内で同じ値または重複する値をXNUMX回だけカウントする方法は?

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

🤖 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 (20)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi, thanks for this formula, I'm having an issue implementing it across two Worksheets. In my example, your columns A and B are on one sheet, and D and E are on another, which collects similar data from other year-based Sheets. If I put the formula on the sheet where D (Area) and E are, in E it just returns a zero =SUMPRODUCT(((MHST2324[@Team]=[@Area]))/COUNTIFS(MHST2324[@Team],MHST2324[@Team]&"",MHST2324[@School],MHST2324[@School]&"")). However if I put the formula on the Sheet where A (Team) and B (School) are, it works =SUMPRODUCT((([@Team]=Schools[Area]))/COUNTIFS([@Team],[@Team]&"",[@School],[@School]&"")), any ideas as to why?
This comment was minimized by the moderator on the site
Hey, thanks for this formula, I'm having a problem where
This comment was minimized by the moderator on the site
Классная формула, но как сделать чтобы в столбец A и B можно было постоянно добавлять и не менять формулу ? закрепить не диапазон а столбцы
This comment was minimized by the moderator on the site
Hello, DM,
In fact, you can enlarg the cell references as you need. For example:
=SUMPRODUCT((($A$2:$A$10000=D2))/COUNTIFS($A$2:$A$10000,$A$2:$A$10000&"",$B$2:$B$10000,$B$2:$B$10000&""))
Please remeber to press Ctrl + Shift + Enter keys together.
Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Is there a way to do this but not count a blank cell as a value?
This comment was minimized by the moderator on the site
Hello, MB
To count the unqiue values with criteria and skip the blank cell, you should apply the below array formula:
=SUM(--(FREQUENCY(IF($B$2:$B$15<>"",IF($A$2:$A$15=D2,MATCH($B$2:$B$15,$B$2:$B$15,0))),ROW($B$2:$B$15)-ROW(B2)+1)>0))


After pasting the fromula, please press Ctrl + Shift + Enter keys together.

https://www.extendoffice.com/images/stories/comments/comment-skyyang/doc-count-unique-criteria.png

Please try, hope it can help you!
This comment was minimized by the moderator on the site
Thank you very much for this but how does it work with a large data set. I realised it returns #N/A when the data is beyond row 78
This comment was minimized by the moderator on the site
I would need to do something similar but with dates: on a sheet in which the dates are indicated in the first column, many repeated, I would like to know how many different dates there are that meet a certain condition that appears in another column. I am applying that formula but it gives me an error. Could you help me? Thanks.
This comment was minimized by the moderator on the site
Does anyone know what the ampersand-quotes (" &"" ") in the Criteria 1 and 2 portion of the COUNTIFS formula is doing? This formula worked for me I was just hoping to understand it better.
This comment was minimized by the moderator on the site
Worked like a charm. Very much greatful to you.
This comment was minimized by the moderator on the site
OMG.... I have been searching for over a week for a formula that came close to helping me do a distinct count of one column based on another column.... YOURS FINALLY HELPED ;0) I am so happy!!!!!! Now I just need this formula that you posted to do the same thing but based on 2 column instead of one. I am going to try on my own but do you think you can help?
This comment was minimized by the moderator on the site
Hello, EB, To count the unique values based on two columns, please apply the below formula, after entering the formula, please press Ctrl + Shift + Enter keys together to get the correct result.=SUM(IFERROR(($A$2:$A$15=E2)*($B$2:$B$15=F2)/COUNTIFS($C$2:$C$15,$C$2:$C$15,$A$2:$A$15,E2,$B$2:$B$15,F2),0))
Please try, hope it can help you!
This comment was minimized by the moderator on the site
WOAH, you're a savior, thank you for sharing
This comment was minimized by the moderator on the site
Nevermind it did
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