How to Identify Matching Records in Excel Spreadsheets: MATCH, IF, and IFERROR Functions Tutorial

In this blog post, we will explore how to use Excel’s MATCH, IF, and IFERROR functions to identify matching records between two spreadsheets. This skill is particularly useful for data analysis, reconciliation tasks, or when you need to merge or compare large sets of data. We’ll provide step-by-step instructions, examples, and tips to help you become proficient in matching records like a pro.


How to Identify Matching Records in Excel Spreadsheets

Step 1: Understanding the Functions
Before we dive into the process, let’s understand what each function does:

– MATCH: This function searches for a specified item in a range of cells and then returns the relative position of that item.
– IF: The IF function checks whether a condition is met and returns one value if true and another value if false.
– IFERROR: This function returns a custom result when a formula generates an error, and a different result if no error is found.

Step 2: Preparing Your Data
Ensure that the data you want to compare is organized in two separate spreadsheets or tables within the same spreadsheet. For simplicity, let’s call them Sheet1 and Sheet2.

Step 3: Using MATCH to Find the Position
To find if a record in Sheet1 exists in Sheet2, you can use the MATCH function. Here’s the syntax:

=MATCH(lookup_value, lookup_array, [match_type])

– `lookup_value` is the value you want to search for.
– `lookup_array` is the range of cells containing possible matches.
– `[match_type]` is optional. Use 0 for an exact match.

Assume you have a list of employee IDs in Sheet1 (column A) and you want to find if they exist in Sheet2 (also column A).

In Sheet1, cell B2, you would enter:

=MATCH(A2, Sheet2!A:A, 0)

This formula will return the position of the employee ID from Sheet1 in the list of IDs in Sheet2.

Step 4: Handling Errors with IFERROR
Sometimes, the MATCH function will return an error if the value is not found. To handle this, wrap the MATCH function with IFERROR.

=IFERROR(MATCH(lookup_value, lookup_array, [match_type]), “Not Found”)

If the MATCH function results in an error, “Not Found” will be displayed instead.

Using the same data as before, in Sheet1, cell B2, you would enter:

=IFERROR(MATCH(A2, Sheet2!A:A, 0), “Not Found”)

Step 5: Returning Custom Results with IF
You might want to return a more informative result than just the position of the match. This is where the IF function comes in.

=IF(ISNUMBER(MATCH(lookup_value, lookup_array, [match_type])), “Match”, “No Match”)

This formula checks if the result of the MATCH function is a number (which means a match was found), and returns “Match” if true, and “No Match” if false.

In Sheet1, cell B2, you would enter:

=IF(ISNUMBER(MATCH(A2, Sheet2!A:A, 0)), “Match”, “No Match”)

Step 6: Combining All Functions
For a robust solution, you can combine MATCH, IF, and IFERROR to get a clean result that indicates whether a match was found and handles errors gracefully.

=IFERROR(IF(MATCH(lookup_value, lookup_array, [match_type]), “Match”), “No Match”)

In Sheet1, cell B2, you would enter:

=IFERROR(IF(MATCH(A2, Sheet2!A:A, 0), “Match”), “No Match”)



By mastering the MATCH, IF, and IFERROR functions in Excel, you can efficiently identify matching records between two spreadsheets. This process is invaluable for data reconciliation, deduplication, and analysis. Remember to ensure your data is well-organized before starting, and use the examples provided as a guide for your own data matching tasks. With practice, you’ll be able to perform these comparisons quickly and accurately, saving you time and reducing the potential for errors in your work.


Live Excel Support Transcript Example:

Below is a live transcript of one of our Excel Support experts helping a customer identify matching records in Excel.

Full Conversation:

Customer: Hello.
Technician: Hi, Carl.
Customer: Hi. How’s it going?
Technician: Good. How are you?
Customer: Pretty good. Good. What can I do for you?
Technician: Thank you. I have two different Excel spreadsheets, and I need to compare them to each other. I guess it’s a VLOOKUP or an index formula. I’m not really sure how to do that.
Customer: Okay. I don’t know if you want to join my screen, or I’ll share my screen, or what’s easier?
Technician: Yeah. You can share your screen. That should work fine.
Customer: Okay. Let me just get it together here. I’m going to share sensitive information you can’t talk about, and I’ll have to come find you.
Technician: All right. Let’s see. Can you see my Excel?
Customer: Yes.
Technician: Okay. This column here, I need to look up or somehow highlight any of those ID numbers that are also found in this second spreadsheet. Are you able to see the second one if I move it over?
Customer: No. When you share a window, I can only ever see that one window. If there’s two spreadsheets, you’ve got to share an entire screen.
Technician: Okay. Let me see. It’d be too easy to have it work the other way. It would be. Who would want that? Okay. How about now? You can see this shorter one?
Customer: Yeah. I can see the shorter one now, yeah.
Technician: Okay. This is the same field here, column A. I need to apply this column to this column and highlight or somehow identify which are the same. This column has 9,200 records, and the other spreadsheet has 703. Okay. How do I do that?
Technician: Yeah. We actually don’t need to use a VLOOKUP because we’re not returning separate data. We’re just getting a match. Okay. What you can do is in B5 there, you can say, let’s see, what’s the best way to do this? If, or sorry, equals if, parentheses, if error, parentheses. Another parentheses or? No, no, no. Open parentheses. Yeah. Okay. Oh, no, no. We need if error. Oh. If error. Yeah. No, sorry. It’s if, and then parentheses, and then if error. Oh. Two separate ifs. Okay. Nice. And then parentheses. And then. New parentheses. Okay. Correct. Yeah. Open parentheses again. And then match. And then a third parentheses. Then A5 comma. Switch over to the other sheet and select that whole A column. Okay. Nice. Then do, back in the formula bar, you want to do comma zero. Then close parentheses. And then that should. Yeah. Okay. So then comma negative one. Close parentheses. Then in, sorry, greater than zero. Comma. Then in quotes, match. And then close quotes. And then comma. And then just double quote, double quote. So it’ll just be blank if there is no match. Okay. And then close parentheses. And that’ll do it. Okay. And then just enter? Yep. So we’ve got a match for that first person. Well, you’ve got to drop it down before we can see the whole thing. Oh, copy this down. Right. So if you just double click the little green square. Or do that. Double click it will take it down to the bottom? Correct. Oh, now I’ve got to try that. I spend my life scrolling. So just double click the corner. Yep. When it turns to the cross, boom. And then enter or? Nope. It’s done. Like if you click on a random B cell, you’ll see that it’s got the formula. There it is. Okay. Interesting. So there are the folks with matches. Interesting. So out of my 9,000, only 176 matched the list of 703. Correct. Okay. I can buy that. Okay. I think that’s all I needed. All right. There you go. Very good. Okay. Cool. Okay. Yeah. Thanks, Carl. Appreciate that. Sure thing. Great. Well, if you need help with anything else in the future, let me know. Otherwise, enjoy your weekend. Thank you. Same to you. Take care. Thanks. Bye. Bye. Bye. Bye.