跳到主要內容

如何計算Excel列中的唯一值或數字?

假設您在工作表的範圍中有一個值列表,現在您想知道其中有多少個唯一值。 如果您一一識別併計算它們,將會浪費很多時間。 因此,在這裡我將向您介紹一些快速的技巧來解決這個問題。

用公式計算唯一值的數量

使用高級過濾器計算唯一值的數量

使用Kutools for Excel計算唯一值的數量


用公式計算唯一值的數量

有一些公式可以幫助您快速計算範圍內唯一值的數量。 例如,如果您的數據是數字,則您有一列範圍在(A1:A10)的數字,請參見屏幕截圖:

文檔計數唯一值1

您可以使用以下公式,具體操作如下:

1。 輸入此公式 =SUMPRODUCT(1/COUNTIF(A1:A10,A1:A10)) 變成一個空白單元格。

文檔計數唯一值1

2。 然後按 Enter 鍵,並顯示唯一值的編號。 看截圖:

文檔計數唯一值1

保養竅門:1.這是另一個公式 =SUM(IF(FREQUENCY(A1:A10, A1:A10)>0,1)) 也可以幫助您。 請隨意申請任何人。 以上兩個公式都將計算唯一值,包括第一個重複值。

2。 如果您的工作表中有一定範圍的文本,則上述公式將不起作用,您應該使用以下數組公式: =SUM(IF(FREQUENCY(IF(LEN(A1:A10)>0,MATCH(A1:A10,A1:A10,0),""), IF(LEN(A1:A10)>0,MATCH(A1:A10,A1:A10,0),""))>0,1))

文檔計數唯一值1

輸入公式後,然後記得按 Shift + Ctrl + 輸入 鍵,並且已顯示唯一值的數量。

文檔計數唯一值1

筆記:

  • 1.範圍 A1:A10 在上述公式中,變量是可變的,您可以根據需要更改它們。
  • 2.此公式還計算包括第一個重複項在內的唯一值。
  • 3.此公式也適用於一系列文本和數字。

使用高級過濾器計算唯一值的數量

您還可以使用“高級篩選器”從一列數據中提取唯一值並將其粘貼到新位置。 然後使用ROWS函數來計算新範圍內唯一值的數量。 具體步驟如下:

1。 點擊 數據 功能區中的選項卡,然後單擊 高級 命令,請參見屏幕截圖:

文檔計數唯一值1

2。 而在中 進階篩選 對話框:

文檔計數唯一值1
  • (1.)選擇 複製到另一個位置 選項下 行動;
  • (2.)在 清單範圍 部分,點擊 文檔按鈕1 按鈕選擇您要使用的範圍數據;
  • (3.)在 複製到 部分,點擊 文檔按鈕1 按鈕,指定要放入過濾後的唯一值的單元格;
  • (4.)最後檢查 僅唯一記錄 選項。

3。 完成設置後,單擊 OK,唯一值已在新列中列出,請參見屏幕截圖:

文檔計數唯一值1

4。 然後在空白單元格中輸入簡短公式 = ROWS(E1:E8),然後按 Enter 鍵盤上的鍵。 並顯示唯一值的數量。

文檔計數唯一值9 -2 文檔計數唯一值10

使用Kutools for Excel計算唯一值的數量

 在這裡,我將向您推荐一個有用的工具- Excel的Kutools,其 選擇重複和唯一單元格 功能,您可以快速選擇重複值或唯一值併計算它們的數量。

Excel的Kutools : 帶有300多個便捷的Excel加載項,可以在30天內免費試用

安裝後 Excel的Kutools,請執行以下步驟:

1. 選擇要計算唯一值的數據范圍。

2。 然後點擊 庫工具 > 選擇 > 選擇重複和唯一單元格,請參見屏幕截圖:

文檔計數唯一值11-11

3。 在 選擇重複和唯一單元格 對話框中選擇 僅唯一值 or 所有唯一(包括第一個重複項) 根據需要,您還可以通過選中 填充背景色 or 填充字體顏色結果處理 部分,請參見屏幕截圖:

文檔計數唯一值12-12

4。 (1.)如果選擇 僅唯一值,則將僅計算和選擇唯一值。 看截圖:

文檔計數唯一值13-13

(2.)如果選擇 所有唯一(包括第一個重複項),包括以下重複項在內的所有唯一值(包括第一個重複項)都會被計數和選擇,如下所示:

文檔計數唯一值14-14

單擊以了解有關此“選擇重複和唯一單元格”功能的更多信息。

立即下載和免費試用Excel的Kutools!


演示:使用Kutools for Excel計算唯一值的數量

Excel的Kutools:具有300多個方便的Excel加載項,可以在30天內免費試用,沒有任何限制。 立即下載並免費試用!


相關文章:

如何在Excel中從選定範圍過濾或選擇唯一記錄?

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為Office帶來了選項卡式界面,使您的工作更加輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!
Comments (18)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
With the new UNIQUE function in Excel 365: COUNTA(UNIQUE(interval)).
This comment was minimized by the moderator on the site
tying to know the values of unique customer for different products, for ex: there are 100 customers, wanted to know out of those how many are unique customers who buy only those products. Likewise: total sales of products = 100 apple = 40 orange = 60 how to find out customers who have brought only oranges and apples?
This comment was minimized by the moderator on the site
in this formula, =SUM(IF(FREQUENCY(MATCH(B2:B10,B2:B10,0),MATCH(B2:B10,B2:B10,0))>0,1)) can i add another "if"? for example i want count the range of unique text in B2:B150 if C2:C150=1 ??? can i?
This comment was minimized by the moderator on the site
How would you seperate unique values in a cell? ie. #2,#2,#3 I only want the #2 to appear once?
This comment was minimized by the moderator on the site
no these formulas are not sufficient, in actual my problem is little bit big, there are lots of column in my sheet, with the name of store id and store name and months in three column respectively and there is repetition of store name in every month a no of time, i have to calculate the unique no of the store name with respect to month. please suggest me the exact formula accordingly.
This comment was minimized by the moderator on the site
Order Rep Status Product Order Value A1 John Close Apple $1 A1 John Close Pear $1.50 A2 John Open Orange $0.50 A3 John Close Grape $3.00 A2 John Open Apple $1 A4 John Close Orange $0.50 A5 Mary Close Apple $1 A6 Peter Close Grape $3.00 Appreciate your advice on this... I am trying to count the unique number of order # (first column), where the rep is John and the order status is closed. the result to achieve is 3 unique orders (A1, A3 and A4). But if i do a countifs function, it literally count the number of 'Close' where rep=John, and that comes back with 4. Is this possible to count unique values against multiple conditions of other columns?
This comment was minimized by the moderator on the site
Anyone know how to make the =SUM(IF(FREQUENCY(A1:A10, A1:A10)>0,1)) formula work to count the number of unique fields for a series of intervals? For example, I want to be able to find out the number of unique entries for each day. My data is structures as ID numbers in Column A, Dates in column B. The data is sorted by the date column. Any help would be very very much appreciated!
This comment was minimized by the moderator on the site
Your formula works a treat and allows me to see the number of unique clients that I have in total (i.e. from all my sales people combined). I am struggling however, to update the formula so that it would allow me to see the number of unique clients an individual sales person would have. Any ideas?
This comment was minimized by the moderator on the site
=SUMPRODUCT(1/COUNTIF(A1:A10,A1:A10))when you are selecting the range make sure that the cells should not be blank.
This comment was minimized by the moderator on the site
Hi, Thank you for your help regarding the duplicates but I'd like to modify your formula =SUM(IF(FREQUENCY(A2:A800, A2:A800)>0,1)) and add this condition (assuming that all the cells are numbers) to count only between 402 to 460 and it goes on to 502 to 560; 602 to 660 (1 formula per range) would it be possible? Thank you very much!
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