Practical Excel skills sharing: data comparison in several different situations
Daily work requires comparing data, finding differences, finding duplicate values, etc. from time to time. Some compare data in the same worksheet, and some compare data between different worksheets. Here we summarize data comparisons in a variety of different situations, and provide quick methods so that everyone can quickly complete data comparisons under different situations.
Part 1: Comparison of data in the same table
1. Strict Compare whether the data in two columns are the same
# The so-called strict comparison refers to the comparison of data according to position.
1) Shortcut key comparison Ctrl
As shown in the figure below, select the two columns of data to be compared, column A and column B, and then press the shortcut key Ctrl. Different The data B5, B9, B10, and B15 will be selected.
2) Comparison of positioning methods (shortcut key F5 or Ctrl G)
The following table is an example, select columns A and Quickly select two columns of data in the column header of column B, then press the shortcut key F5 (or Ctrl G) to bring up the positioning window, select the positioning condition as "row content difference cells", click the "OK" button, different data will be selected.
Note:
The above two methods can quickly compare the differences between two columns of data, but they will not distinguish between uppercase and lowercase letters.
3) Comparison of IF functions
(1) Comparison of if functions that do not require case-sensitive letters
Both columns A and B in the table below are It is a number, there are no letters, and it does not need to be case sensitive.
You can enter the formula =IF(A2=B2, "Same", "Not the same") in cell C2. After inputting, pull the handle and drag it down until The data in this column are cut off, and the same and different results are clear at a glance, as shown in the table below.
(2) Case-sensitive if function comparison
If the comparison data contains letters and needs to be case-sensitive, the above formula cannot be accurate Compared. At this time, you can change the C2 formula to =IF(EXACT(A2,B2)=TRUE,"Same","Not the same"), and then drop down to fill in the formula, as shown in the figure below.
2. Find duplicate values in two columns of data
1) IF MATCH Function to find duplicate values
Now we want to find out the list of winners for two consecutive quarters in the following table, what method is there?
In fact, it is necessary to find duplicate values by comparing column A and column B. We can use the IF MATCH function to combine formulas, enter the formula =IF(ISERROR(MATCH(A2,$B$2:$B$25,0)),"",A2)
in cell C2, and then pull down Copy the formula to complete the search task. See the table below for comparison search results:
Formula analysis:
MATCH is used to return the position of the data A2 to be found in the area $B$2:$B$25. If it is found, a line number will be returned (indicating that there is a duplication), if not found, an error #N/A will be returned (indicating that there is no duplication).
Add the ISERROR function to the formula to determine whether the value returned by MATCH is an error #N/A. If it is an error #N/A, it will return TRUE. If it is not an error #N/A, it will range from FALSE.
The outermost IF function returns different values depending on whether ISERROR (MATCH ()) is TRUE or FALSE. If it is TRUE (that is, there is no repetition), it returns empty; if it is FALSE, it returns A2.
If we want to find out the list of winners in the first quarter but not in the second quarter, we can change the above function formula to: =IF(ISERROR(MATCH(A2,$B$2 :$B$25,0)),
A2, "")
.
2) IF COUNTIF function finds duplicate values
The two columns A and B in the table below are the names of customers. You need to find the duplicate customer names in the two columns and put them in Column C is marked.
The operation method is to enter the formula =IF(COUNTIF(A:A,B2)=0,"",B2) in cell C2, and then pull down to complete the two columns of excel Data comparison. Please see the demo below!
The COUNTIF function is a function that counts cells in a specified range that meet specified conditions.
Test you:
If the numerical value compared above exceeds 15 digits, for example, the comparison is ID number, can the above formula still be used? If the above formula cannot be used, what about changing it to the following formula?
=IF(COUNTIF(A: A,B2&"*")=0," ",B2)
or
=IF(SUMPRODUCT(1*(A:A=B2)),B2,"")
If you don’t know the answer, please watch the tutorial " The card number is bizarre and reduced. My cousin was unjustly punished. ——Excel, it turns out you have duplicates of true and false! 》.
3) IF VLOOKUP function finds duplicate values
As shown in the table below, there are two sets of employee numbers. I don’t know which ones are common to both groups A and B. We can also use the if VLOOKUP function formula to complete the comparison.
Enter the formula in cell C2: =IF(ISNA(VLOOKUP(A2,$B$2:$B$25,1,))," " ,A2)
, and then pull down to copy the formula, you can find the duplicate values in the two columns of data in Excel.
Formula analysis:
The ISNA function is used to determine whether the value is an error value #N/A (that is, the value does not exist ), if yes, returns TRUE; otherwise returns FALSE.
In the formula, you need to add the $ sign before the data in the search area to fix the search area. Otherwise, the search area will also change when the drop-down is filled, which will affect the search and comparison results.
App Extension: Find Differences with Vlookup
This formula can be slightly adjusted to find different values, or missing values or wrong values (non-strict comparison, not paying attention to position or order). For example, the above group B is standard data. To find the values in group A that are different from group B, the formula can be written as:
=IF(ISNA(VLOOKUP(A2,$B$2:$ B$25,1,)),
A2, " ")
Part 2: Cross-table data comparison
1. Strictly compare whether the data of the two tables are the same
When two tables with exactly the same format are compared to find differences, the following method can be used.
1) Conditional formatting method to compare the differences between the two tables
Now take the following two tables as an example to compare which values are different and highlight them.
First, select a table, create a new rule, and select "Use formulas to determine the cells to be formatted", then enter =A9A1, for the corresponding cells Make a judgment to determine whether they are equal. Please see the demo below!
Warm reminder:
If you want to clear conditional formatting, first select the cell range to clear the format, and then Execute "Start" - "Conditional Formatting" - "Clear Rules" - "Clear Rules for Selected Cells" (or clear the rules for the entire worksheet).
2) Compare the differences between the two tables using the special paste method (this method is only suitable for comparison of numbers)
As shown in the figure below, the two tables have the same format and the same name ordering. It is required to quickly find the data differences between two tables.
Copy one of the numerical areas, then press the shortcut key Ctrl Alt V to paste selectively, set it to "subtraction" operation, click "OK", the non-0 part is The difference lies. Please see the demo below!
This method is only suitable for quickly locating differential data, just at a glance, because it will destroy the original data table.
3) IF function compares the differences between the two tables
As shown in the figure below, table a and table b are tables with exactly the same format. Now it is required to check the two tables Whether the values are completely consistent, and the differences must be visually displayed.
The operation method is to create a new blank worksheet and enter the formula =IF(Table a!A1 Table b!A1, "Table a:"& Table a!A1&" vs table b:"& table b!A1,""), then copy the fill formula within the range. Please see the demo below!
2. Find the difference between the data in the two tables according to conditions
1) Find the difference between the data in two tables using a single condition
For example, the following is a score table summarized by two people. The table format is the same, but the name ordering is different. Now you need to compare the two tables to verify whether the summary results are correct.
This type of data verification is a single condition verification. Because it is compiled by different people, in addition to checking the scores by name, it is also necessary to mark those whose names do not match. We do this using conditional formatting.
Two conditional formats need to be established.
The first format: Find the name difference
(1) Select the name column data of the second table, select "New Rule" in "Conditional Formatting", and in the pop-up In the dialog box, select "Use a formula to determine the cells to be formatted", and then enter the formula =COUNTIF($A$2:$A$10,A14)=0
(2) Click the Format button and select A fill color.
After confirmation, we will complete the first format setting.
The second format: Find the difference in scores for the same name.
(1) Select all the score cells in the second table, create a new rule, and use the formula to determine the rule. The entered formula is = =VLOOKUP($A14,$A$1:$I$10,COLUMN(B1),0)-B14
(2) Click the format button and select a fill color.
Complete the score check after confirmation. The overall verification results are as follows:
Orange indicates that the name "Liu Xiaoguang" does not match another table, and the name may be written incorrectly; blue-green indicates Yang Wenwen's Chinese score , He Congliang's English score, and Hou Manman's Chinese score do not match, and there may be errors.
2) Multiple conditions to find the difference in the data of the two tables
As shown in the figure below, it is required to check the quantity difference of the same product in the same warehouse in the two tables, and the results are shown In column D. In what way can this be accomplished? What a headache!
Enter the following formula in cell D15:
=SUMPRODUCT(($A$3:$A$11=A15)*($ B$3:$B$11=B15)*$C$3:$C$11)-C15
Then pull down to complete the comparison of the values. Please see please see! !
The above is today’s sharing, let’s practice together
Related learning recommendations: excel tutorial
The above is the detailed content of Practical Excel skills sharing: data comparison in several different situations. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











If when opening a file that needs to be printed, we will find that the table frame line has disappeared for some reason in the print preview. When encountering such a situation, we must deal with it in time. If this also appears in your print file If you have questions like this, then join the editor to learn the following course: What should I do if the frame line disappears when printing a table in Excel? 1. Open a file that needs to be printed, as shown in the figure below. 2. Select all required content areas, as shown in the figure below. 3. Right-click the mouse and select the "Format Cells" option, as shown in the figure below. 4. Click the “Border” option at the top of the window, as shown in the figure below. 5. Select the thin solid line pattern in the line style on the left, as shown in the figure below. 6. Select "Outer Border"

Excel is often used to process data in daily office work, and it is often necessary to use the "filter" function. When we choose to perform "filtering" in Excel, we can only filter up to two conditions for the same column. So, do you know how to filter more than 3 keywords at the same time in Excel? Next, let me demonstrate it to you. The first method is to gradually add the conditions to the filter. If you want to filter out three qualifying details at the same time, you first need to filter out one of them step by step. At the beginning, you can first filter out employees with the surname "Wang" based on the conditions. Then click [OK], and then check [Add current selection to filter] in the filter results. The steps are as follows. Similarly, perform filtering separately again

In our daily work and study, we copy Excel files from others, open them to add content or re-edit them, and then save them. Sometimes a compatibility check dialog box will appear, which is very troublesome. I don’t know Excel software. , can it be changed to normal mode? So below, the editor will bring you detailed steps to solve this problem, let us learn together. Finally, be sure to remember to save it. 1. Open a worksheet and display an additional compatibility mode in the name of the worksheet, as shown in the figure. 2. In this worksheet, after modifying the content and saving it, the dialog box of the compatibility checker always pops up. It is very troublesome to see this page, as shown in the figure. 3. Click the Office button, click Save As, and then

eWe often use Excel to make some data tables and the like. Sometimes when entering parameter values, we need to superscript or subscript a certain number. For example, mathematical formulas are often used. So how do you type the subscript in Excel? ?Let’s take a look at the detailed steps: 1. Superscript method: 1. First, enter a3 (3 is superscript) in Excel. 2. Select the number "3", right-click and select "Format Cells". 3. Click "Superscript" and then "OK". 4. Look, the effect is like this. 2. Subscript method: 1. Similar to the superscript setting method, enter "ln310" (3 is the subscript) in the cell, select the number "3", right-click and select "Format Cells". 2. Check "Subscript" and click "OK"

When processing data, sometimes we encounter data that contains various symbols such as multiples, temperatures, etc. Do you know how to set superscripts in Excel? When we use Excel to process data, if we do not set superscripts, it will make it more troublesome to enter a lot of our data. Today, the editor will bring you the specific setting method of excel superscript. 1. First, let us open the Microsoft Office Excel document on the desktop and select the text that needs to be modified into superscript, as shown in the figure. 2. Then, right-click and select the "Format Cells" option in the menu that appears after clicking, as shown in the figure. 3. Next, in the “Format Cells” dialog box that pops up automatically

Most users use Excel to process table data. In fact, Excel also has a VBA program. Apart from experts, not many users have used this function. The iif function is often used when writing in VBA. It is actually the same as if The functions of the functions are similar. Let me introduce to you the usage of the iif function. There are iif functions in SQL statements and VBA code in Excel. The iif function is similar to the IF function in the excel worksheet. It performs true and false value judgment and returns different results based on the logically calculated true and false values. IF function usage is (condition, yes, no). IF statement and IIF function in VBA. The former IF statement is a control statement that can execute different statements according to conditions. The latter

In the study of software, we are accustomed to using excel, not only because it is convenient, but also because it can meet a variety of formats needed in actual work, and excel is very flexible to use, and there is a mode that is convenient for reading. Today I brought For everyone: where to set the excel reading mode. 1. Turn on the computer, then open the Excel application and find the target data. 2. There are two ways to set the reading mode in Excel. The first one: In Excel, there are a large number of convenient processing methods distributed in the Excel layout. In the lower right corner of Excel, there is a shortcut to set the reading mode. Find the pattern of the cross mark and click it to enter the reading mode. There is a small three-dimensional mark on the right side of the cross mark.

1. Open the PPT and turn the page to the page where you need to insert the excel icon. Click the Insert tab. 2. Click [Object]. 3. The following dialog box will pop up. 4. Click [Create from file] and click [Browse]. 5. Select the excel table to be inserted. 6. Click OK and the following page will pop up. 7. Check [Show as icon]. 8. Click OK.
