介紹如何在 Excel 中使用條件式格式設定,比較兩張表格,找出不同的地方。
比較兩張表格差異
假設我們有兩張表格,欄位完全相同,但一張表格是舊的資料,另外一張表個則是修改過的新資料:
![兩張資料表格 兩張資料表格](https://officeguide.cc/wp-content/uploads/2021/07/excel-compare-two-excel-sheets-tutorial-examples-20210720-01.png)
由於兩張表格中的資料很多,要找出有哪些地方被改過,是一件很不容易的事情。以下我們將使用 Excel 的條件式格式設定,快速找出兩張表格的差異之處。
Step 1
選取其中一張表格的資料範圍(也就是要進行比較的資料範圍)。
![選取資料範圍 選取資料範圍](https://officeguide.cc/wp-content/uploads/2021/07/excel-compare-two-excel-sheets-tutorial-examples-20210720-02.png)
Step 2
在「常用」頁籤中,選擇「條件式格式設定」中的「新增規則」。
![新增規則 新增規則](https://officeguide.cc/wp-content/uploads/2021/07/excel-compare-two-excel-sheets-tutorial-examples-20210720-03.png)
在「選取規則類型」中,選擇「使用公式來決定要格式化哪些儲存格」。
![選擇「使用公式來決定要格式化哪些儲存格」 選擇「使用公式來決定要格式化哪些儲存格」](https://officeguide.cc/wp-content/uploads/2021/07/excel-compare-two-excel-sheets-tutorial-examples-20210720-12.png)
Step 4
在「格式化在此公式為 True 的值」中,填入以下公式比較兩張表格的第一個儲存格是否相等(這裡的 <>
是不等於的意思):
=A2<>F2
![新增格式化規則 新增格式化規則](https://officeguide.cc/wp-content/uploads/2021/07/excel-compare-two-excel-sheets-tutorial-examples-20210720-04.png)
在這裡如果是用滑鼠來選取儲存格,必須把自動產生的錢字號($
)去除,這樣才能順利將公式套用至整張表格。
Step 5
設定差異儲存格的格式,這裡我們將差異的儲存格設定以橘色填滿。
![設定填滿顏色 設定填滿顏色](https://officeguide.cc/wp-content/uploads/2021/07/excel-compare-two-excel-sheets-tutorial-examples-20210720-05.png)
Step 6
設定好公式以及儲存格格式之後,按下「確定」。
![新增格式化規則 新增格式化規則](https://officeguide.cc/wp-content/uploads/2021/07/excel-compare-two-excel-sheets-tutorial-examples-20210720-06.png)
Step 7
這樣就會自動將兩張表格的差異之處,以指定的儲存格格式標示出來。
![標示兩張表格資料差異處 標示兩張表格資料差異處](https://officeguide.cc/wp-content/uploads/2021/07/excel-compare-two-excel-sheets-tutorial-examples-20210720-07.png)
比較兩張工作表差異
假設我們有不同版本的表格存在於 Excel 不同的工作表中:
![不同版本的工作表 不同版本的工作表](https://officeguide.cc/wp-content/uploads/2021/07/excel-compare-two-excel-sheets-tutorial-examples-20210720-08.png)
若要找出兩張工作表之間的差異,做法也都類似。
Step 1
任選其中一張工作表的資料範圍。
![選取資料範圍 選取資料範圍](https://officeguide.cc/wp-content/uploads/2021/07/excel-compare-two-excel-sheets-tutorial-examples-20210720-09.png)
Step 2
依照類似的方式設定判斷公式與儲存格格式,但要注意這裡的公式涉及到不同的工作表,所以在公式的右半部要指定另一張工作表名稱,加上驚嘆號後,再加上另一張工作表的儲存格位置。
=A2<>訂單B!A2
![新增格式化規則 新增格式化規則](https://officeguide.cc/wp-content/uploads/2021/07/excel-compare-two-excel-sheets-tutorial-examples-20210720-10.png)
Step 3
這樣就可以標示出兩張工作表的差異之處了。
![標示兩張工作表差異處 標示兩張工作表差異處](https://officeguide.cc/wp-content/uploads/2021/07/excel-compare-two-excel-sheets-tutorial-examples-20210720-11.png)