How to Use the MATCH Function to Compare Lists in Excel 2007 and Excel 2010 With Examples

Updated on October 19, 2016

Introduction

Hi and welcome to my latest hub on Excel. In today’s hub, I will look at how to use the MATCH function to compare lists with an example to illustrate how to use it. The MATCH function takes an item and compares it to a list and tells you the items relative position in that list.

The example I will use is a football (soccer) league table. The results will ultimately allow me to show whether teams in the league are going up or down over time.

  • I will use the MATCH function to determine a team's position in the league for both this week and last week's league
  • Nested IF statements are then used to determine if a teams position changed from one week to the next
  • We will then use Conditional Formatting with an Icon Set to visually show the team’s position in the table compared to the previous table

Once completed, our league table will look like this:

Football (soccer) League table created using the MATCH and IF functions, with Conditional Formatting created using Excel 2007 and Excel 2010.
Football (soccer) League table created using the MATCH and IF functions, with Conditional Formatting created using Excel 2007 and Excel 2010. | Source

I have another hub that illustrates how to use the MATCH function, this time to create Top Ten lists. I use the MIN, MAX, SMALL and LARGE functions alongside MATCH and INDEX to create the lists. My hub can be found here.

To learn more about Conditional Formatting and how you can add visually striking formatting to your spreadsheets, I have a hub that goes into greater detail on using it. This hub is located here.


Further information on using nested IF statements as well as using the logical functions AND OR and NOT with IF, as well as using IFERROR to suppress expected errors can be found in my hub here.

Using the MATCH function in Excel 2007 and Excel 2010

The MATCH function in Excel lets you look for an item in a list and tells you its relative position in that list. Using an example:

=MATCH($E3,$E$3:$E$26,0)

Example of how to use the MATCH function in Excel 2007 and Excel 2010.
Example of how to use the MATCH function in Excel 2007 and Excel 2010. | Source

This formula will look for the contents of E3 (Doncaster Rovers) in the rangeE3 – E26. The 0 at the end of the formula (known as the Match Type) tells Excel to only look for an exact match.

The result of our formula is 1 as Doncaster Rovers is the first item in the list.

Note: if Match Type equals 1, MATCH will find the largest value that is less than or equal to the value you are asking Excel to look for. The list you are asking Excel to look in must be in ascending order.

Note: If Match Type equals -1, MATCH will look for the smallest value which is greater than or equal to the value you are interested in. The list in this instance must be in descending order.

Note: if Match Type equals 0, MATCH will look only for an exact match. If the item you are asking Excel to find or the items in the list do not match exactly, then MATCH will fail to find it in the list. Use the TRIM function to remove all spaces from text.

To complete the formulas for the entire list, copy or drag the formula down to the remaining cells.

Note: the use of the $ in this formula as these are particularly important. These ensure that the list remains the same throughout and the only thing that changes is the row number of the item you are asking Excel to match.

In order to calculate last weeks table positions, use the same formula as above, just change the list Excel is looking at.


=MATCH($E3,$K$3:$K$26,0)


When completed, the matches for each team for this week and last week will appear in the cells Q3 to Q26 and R3 to R26.

Using Conditional Formatting and Icon Sets to display results of the MATCH function in Excel 2007 and Excel 2010

The next step in our example is to convert the two lists of the MATCH results into something that we can use so that Conditional Formatting can show us how each team performs week to week.

Note: Unfortunately, you cannot use Icon Sets with formulas, so we need to convert the results into something that will work with them.

To do this, we use nested IF statements. The equation we will use in column S is:


=IF(R3>Q3, "3", IF(R3=Q3,"2",IF(R3<Q3,"1")))


So if a team goes up from one week to the next, it gets a 3 in column S. It gets 2 if there is no change and 1 if it drops.

  • Copy the formula to the rest of the cells so that each item gets a 1, 2 or 3 depending on its performance.

Now we need to convert these values to numbers.

  • Select them all
  • Right click and select Format Cells
  • Select Number under Category
  • Set Decimal Places to 0

Unfortunately, Icon sets will not work with the results of a formula either, so to resolve this:

  • Select the cells and right click
  • Choose Copy
  • Click on where you want your Icon Set to be and choose Paste Special
  • Select Paste Values

Now we have a column of numbers which we don’t want to see. To hide them:

  • Select them all
  • Right click and select Format Cells
  • Click on Custom
  • Type in three semi-colons
  • Press OK

This will hide the contents of the cells, unless they are clicked on

How to use Custom Formatting to hide the contents of a cell in Excel 2007 and Excel 2010.
How to use Custom Formatting to hide the contents of a cell in Excel 2007 and Excel 2010. | Source

Finally, we now have data that Conditional Formatting can use with Icon Sets. Now we need to create our Conditional Formatting. To do this:

  • Select the data (A3 – A26 in my example)
  • On the Home tab in the Styles Group, click the Conditional Formatting button
  • Click New Rule
  • Leave Select a Rule Type as Format all cells based on their values
  • Under Format Style, select Icon Sets
  • Change Type to Number for both Green and Yellow
  • For Green, type 3 into Value and for Yellow type 2
  • Finally, choose 3 Arrows (coloured) for your Icon Style

You should end up with the below:

How to use Conditional Formatting Icon Sets in Excel 2007 and Excel 2010.
How to use Conditional Formatting Icon Sets in Excel 2007 and Excel 2010. | Source

Conclusion

The MATCH function allows us to find out where an item appears in a list relative to other items. Using an example of a football (soccer) league table we were able to determine if a team went up or down in the league over time using MATCH to compare lists. We then used nested IF statements to convert these results to a number which we could display visually using Conditional Formatting Icon Sets. The spreadsheet when completed looked like this:

Completed spreadsheet showing football league table created using MATCH and nested IF statements with Conditional Formatting in Excel 2007 and Excel 2010.
Completed spreadsheet showing football league table created using MATCH and nested IF statements with Conditional Formatting in Excel 2007 and Excel 2010. | Source

I hope that you found this hub useful and informative and that you have discovered how powerful the MATCH function is and how to use it in your own spreadsheets. Please leave any comments you may have below and thanks for reading!

Questions & Answers

    Comments

      0 of 8192 characters used
      Post Comment

      No comments yet.

      working

      This website uses cookies

      As a user in the EEA, your approval is needed on a few things. To provide a better website experience, hubpages.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

      For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: "https://turbofuture.com/privacy-policy#gdpr"

      Show Details
      Necessary
      HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
      LoginThis is necessary to sign in to the HubPages Service.
      Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
      AkismetThis is used to detect comment spam. (Privacy Policy)
      HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
      HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
      Amazon Web ServicesThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized. (Privacy Policy)
      CloudflareThis is used to quickly and efficiently deliver files such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
      Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
      Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
      PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
      Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
      Features
      Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
      Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
      Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
      Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
      VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
      MavenThis supports the Maven widget and search functionality. (Privacy Policy)
      Marketing
      Google AdSenseThis is an ad network. (Privacy Policy)
      Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
      Index ExchangeThis is an ad network. (Privacy Policy)
      SovrnThis is an ad network. (Privacy Policy)
      Facebook AdsThis is an ad network. (Privacy Policy)
      Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
      AppNexusThis is an ad network. (Privacy Policy)
      OpenxThis is an ad network. (Privacy Policy)
      Rubicon ProjectThis is an ad network. (Privacy Policy)
      TripleLiftThis is an ad network. (Privacy Policy)
      Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
      Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
      Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisements has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
      Statistics
      Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
      ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
      Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)