學(xué)習(xí)教程:在Excel表格的兩列數(shù)據(jù)中提取不重復(fù)值?
方法一:用“刪除重復(fù)項”功能
將上述A、B兩列中的數(shù)據(jù)復(fù)制粘貼到其他區(qū)域,例如D2:E19區(qū)域,選擇D2:E19,在“數(shù)據(jù)”選項卡的“數(shù)據(jù)工具組”中單擊“刪除重復(fù)項”,在彈出的對話框中點“確定”。

Excel即可自動將重復(fù)值刪除,得到兩列中的唯一值。


該方法較為快捷,適用于Excel 2007以上版本,但如果兩列中的數(shù)據(jù)發(fā)生更改后還需重新操作。
方法二:用高級篩選
選擇兩列中的某個單元格,在“數(shù)據(jù)”選項卡的“排序和篩選”組中點“高級”。如果出現(xiàn)“Microsoft Excel 無法確定當前列表或選定區(qū)域的哪一行包含列標簽,……”對話框,單擊“確定”,彈出“高級篩選”對話框,將“列表區(qū)域“設(shè)置為A、B兩列,選擇“將篩選結(jié)果復(fù)制到其他位置”,將“復(fù)制到”設(shè)置為D2單元格,“條件區(qū)域”保留為空,同時勾選“選擇不重復(fù)的記錄”,單擊“確定”。


Excel會將A、B兩列中的唯一值提取到D、E兩列。


如果以后繼續(xù)在A、B兩列添加數(shù)據(jù),再次進行高級篩選時Excel會保存上次的區(qū)域設(shè)置,還是比較方便的。
方法三:用數(shù)組公式
這種方法適合于數(shù)據(jù)量不大的情況。選擇D2:E2區(qū)域,在編輯欄中輸入數(shù)組公式:
=INDEX(A:B,SMALL(IF(MATCH(A$2:A$19&B$2:B$19,A$2:A$19&B$2:B$19,)=ROW($1:$18),ROW($2:$19),4^8),ROW(A1)),{1,2})&""
按Ctrl+Shift+Enter結(jié)束輸入,然后選擇D2:E2,拖動填充柄向下填充公式,直到出現(xiàn)空白為止。
說明:公式用SMALL、IF和MATCH函數(shù)得到同行數(shù)據(jù)相連接后第一次出現(xiàn)的行號,再用INDEX函數(shù)同時返回A、B兩列的唯一值數(shù)據(jù)。
方法四:使用數(shù)據(jù)透視表
1、如果A、B兩列的數(shù)據(jù)需要更改或添加,可先將這兩列數(shù)據(jù)轉(zhuǎn)換為表格。方法是選擇兩列數(shù)據(jù)中的某個單元格,在“插入”選項卡的“數(shù)據(jù)”組中單擊“表格”,彈出“插入表”對話框,單擊確定。


2、再次選擇兩列數(shù)據(jù)中的某個單元格,在“數(shù)據(jù)”組中單擊“數(shù)據(jù)透視表”,彈出“創(chuàng)建數(shù)據(jù)透視表”對話框,選擇放置數(shù)據(jù)透視表的位置,本例為同一工作表中的D2單元格,單擊“確定”。
3、在“數(shù)據(jù)透視表字段列表”中勾選“貨號”和“尺碼”兩個字段,將其添加到數(shù)據(jù)透視表。


4、修改數(shù)據(jù)透視表的外觀和布局。
①在“數(shù)據(jù)透視表工具--設(shè)計”選項卡中,分別單擊“報表布局→以表格形式顯示”和“報表布局→重復(fù)所有項目標簽”。
②在“數(shù)據(jù)透視表工具--設(shè)計”選項卡中,單擊“分類匯總→不顯示分類匯總”。
③在“數(shù)據(jù)透視表工具--分析”選項卡的“顯示”組中,單擊取消選擇“+-按鈕”。


這樣就得到了A、B兩列中的不重復(fù)值。以后在A、B兩列數(shù)據(jù)后的空單元格中添加數(shù)據(jù)后,Excel會自動擴展表格,刷新數(shù)據(jù)透視表即可得到新的唯一值數(shù)據(jù)。
繼續(xù)查找其他問題的答案?
-
Excel 2019如何使用復(fù)制、粘貼命令插入Word數(shù)據(jù)?(視頻講解)
2021-01-257次播放
-
Excel 2019如何制作數(shù)據(jù)透視表?(視頻講解)
2021-01-2227次播放
-
Excel 2019如何設(shè)置相對引用?(視頻講解)
2021-01-2210次播放
-
2021-01-2212次播放
-
Excel 2019如何使用命令復(fù)制公式?(視頻講解)
2021-01-226次播放
-
2021-01-223次播放
-
2021-01-222次播放
-
Excel 2019如何利用開始選項卡進入篩選模式?(視頻講解)
2021-01-223次播放
-
Excel 2019如何設(shè)置指定數(shù)據(jù)的篩選?(視頻講解)
2021-01-223次播放
-
Excel 2019如何設(shè)置自定義排序?(視頻講解)
2021-01-222次播放
點擊加載更多評論>>