• Skip to content [Accesskey '1']
  • Skip to navigation [Accesskey '2']
CIMA - Chartered Institute of Management Accountants Chartered Institute of Management Accountants
  • Select your location
    • Africa
    • Australia
    • Bangladesh
    • Benelux
    • Brazil
    • Canada
    • Central Eastern Europe
    • China
    • France
    • Germany
    • Gibraltar
    • Greece
    • Hong Kong SAR
    • India
    • Indonesia
    • Iran
    • Ireland
    • Israel
    • Italy
    • Kenya
    • Malaysia
    • Malta
    • Middle East
    • Myanmar
    • Nepal
    • New Zealand
    • Nigeria
    • Pakistan
    • Philippines
    • Poland
    • Russia and CIS
    • Singapore
    • Spain
    • Sri Lanka
    • Switzerland
    • Thailand
    • Turkey
    • United Kingdom
    • USA
    • Vietnam
  • Jobs
  • FM Magazine
  • CIMAsphere community
  • CGMA
MY CIMA

Login to MY CIMA

Login to MY CIMA

Login below to access our online services for members, students and business partners.

Forgotten your contact ID or password?
Don't have an account?
  • Home
  • Study with us
    • Why choose CIMA?
    • How to start CIMA
    • CIMA course providers
    • Exemptions
    • CIMA Certificate in Business Accounting
    • CIMA Professional Qualification
    • Islamic finance qualifications
  • Students
    • Exam preparation
    • Certificate exam information
    • Professional exam information
    • Practical experience requirements
    • Fees
    • Professional development
    • Exam award listings
    • Student e-magazine
  • Members
    • Becoming a member
    • Getting the CGMA designation
    • Fees and payment
    • CIMA professional development
    • Members' handbook
    • Find a CIMA accountant
    • New members
    • Monitoring of members working as practising accountants
    • Member FAQs
  • CIMA in business
    • CIMA value in the private sector
    • CIMA value in the public sector
    • CIMA value in growing businesses
    • CIMA Training and Development Accreditation
    • CGMA
  • Events and CPD courses
    • CIMA Global Business Challenge
    • Mastercourses
    • Members in practice events
    • Local events
    • CIMA conferences and academies
    • Bitesize briefings
    • CPD technical updates
    • Student courses
    • CIMA on demand
    • Accredited CPD products
  • Innovation
  • Professionalism
    • Professionalism and employability
    • Ethics
    • Conduct
    • Members' handbook
  • About us
    • Why CIMA?
    • Our mission, behaviours and strategy
    • Celebrating 90 years
    • CIMA case studies and profiles
    • Governance, charter and byelaws
    • Press office
    • Advertise with us
    • Partners
    • Jobs at CIMA
    • What is management accounting?
    • 2012 annual review
  1. Home
  2. Innovation
  3. E-magazines
  4. Insight
  5. Insight 2009
  6. Insight March 2009
  7. Spreadsheet skills: INDEX and MATCH make powerful combo

Spreadsheet skills: INDEX and MATCH make powerful combo

March 2009

This month, in our series of articles providing solutions to issues encountered by finance professionals, we look at one of the most powerful combinations of Excel functions for looking up data: INDEX and MATCH. By Liam Bastick, associate director with SumProduct.


Query

Preparing financial statements in Excel, I want to construct a formula that will tell me if my balance sheet is balancing, and, if not, which is the first period that the misbalance occurs in.



Balance Sheet Summary Illustration
 


Advice
This is a common modelling query. The usual suspects, LOOKUP and HLOOKUP / VLOOKUP do not work here:

  • LOOKUP(lookup_value, lookup_vector,[result_vector]) gives the wrong date as the balance checks are not in strict ascending order (that is, ascending alphanumerically with no duplicates)
  • HLOOKUP(lookup_value,table_array,row_index_num,[range_lookup]) gives #VALUE! since the first row must contain the data to be ‘looked up’, but the Balance Check is in row 28 in our example above, whereas the dates we need to return are in row 6 – hence we get a syntax error.

There is a solution, however: INDEX MATCH. They form a highly versatile tag team, but are worth introducing individually.


Index
Essentially, INDEX(array, row_num,[column_num]) returns a value or the reference to a value from within a table or range (list). For example, INDEX({7,8,9,10,11,12},3) returns the third item in the list {7,8,9,10,11,12}, that is 9. This could have been a range: INDEX(A1:A10,5) gives the value in cell A5, etc.

INDEX can work in two dimensions as well (hence the column_num reference). Consider the following example:



Two Dimensional INDEX Example
 
INDEX(F11:L21,4,5) returns the value in the fourth row, fifth column of the table array F11:L21 (clearly 26 in the above illustration).

Match
MATCH(lookup_value,lookup_array,[match_type]) returns the relative position of an item in an array that (approximately) matches a specified value. It is not case sensitive.

The third argument, match_type, does not have to be entered, but for many situations, I strongly recommend that it is specified. It allows one of three values:

  • match_type 1 [default if omitted]: finds the largest value less than or equal to the lookup_value – but the lookup_array must be in strict ascending order, limiting flexibility
  • match_type 0: probably the most useful setting, MATCH will find the position of the first value that matches lookup_value exactly. The lookup_array can have data in any order and even allows duplicates
  • match type -1: finds the smallest value greater than or equal to the lookup_value – but the lookup_array must be in strict descending order, again limiting flexibility.

When using MATCH, if there is no (approximate) match, #N/A is returned (this may also occur if data is not correctly sorted depending upon match_type).

MATCH is fairly straightforward to use:



MATCH Example
 
In the figure above, MATCH(“d”,F12:F22,0) gives a value of 6, being the relative position of the first ‘d’ in the range. Note that having match_type 0 here is important. The data contains duplicates and is not sorted alphanumerically. Consequently, match_types 1 and -1 would give the wrong answer: 7 and #N/A respectively.

Index Match
While useful functions in their own right, combined they form a highly versatile partnership. Consider our original problem:



Balance Sheet Summary Illustration (Revisited)

 
MATCH(1,J28:O28,0) equals 5, that is, the first period the balance sheet does not balance in is Period 5. But we can do better than that.

INDEX(J6:O6,5) equals May-09, so combining the two functions:
INDEX(J6:O6,MATCH(1,J28:O28,0)) equals May-09 in one step, and answers our reader’s query.

Note how flexible this combination really is. We do not need to specify an order for the lookup range, we can have duplicates and the value to be returned does not have to be in a row / column below / to the right of the lookup range (indeed, it can be in another workbook never mind another worksheet!).

With a little practice, the above technique can be extended to match items on a case sensitive basis, use multiple criteria and even ‘grade’. The attached workbook provides several examples as illustrations.

If you have a query for the spreadsheet skills section, please feel free to drop Liam a line at liam.bastick@sumproduct.com or visit the SumProduct website where you can also subscribe to the new monthly newsletter providing more tricks and tips.

Search for 'spreadsheet' at CIMA Mastercourses

March 2009

  1. Insight March 2009
    • Certificate in Islamic Finance
    • CIMA Online courses - special offer
    • CIMA sponsors FT Global Outsourcing and Offshoring Conference - discount for members
    • CIMA warns small businesses not to lose sight of strategy
    • CIMA warns small businesses not to lose sight of strategy
    • Credit crunch: problems and opportunities for SMEs
    • Do you do Web 2.0?
    • Enrol on the Fastrack ACT qualification (members only)
    • European Shared Services & Outsourcing Week: member discount
    • Financial reporting news: axe roadmap, say US States
    • Get more from your enterprise performance management
    • How to become a member of CPA or CMA
    • How to generate cash by optimising your working capital
    • Is your marketing profitable? One day conference
    • Learning about leadership from Obama
    • Letters - fixing South Africa's ethical problems
    • More news and events by global region
    • Namibia moves to address shortage of accountants
    • New members’ handbook focuses on accountants in business
    • Spreadsheet skills: INDEX and MATCH make powerful combo
    • Supporting accountants in creating sustainable value
    • Survey shows hot and cold spots for finance professionals
    • Survey shows hot and cold spots for finance professionals
    • Survey to boost best practice in financial control
    • True tales of success in a fast-growing SME
    • Up to 50% off selected Mastercourses

Find us on

Facebook logoLinked In logoTwitter logoYouTube logo

In this issue:

Features

  • In this issue
  • Story one
  • True tales of success in a fast-growing SME
  • Financial reporting news: axe roadmap, say US States
  • Spreadsheet skills: INDEX and MATCH make powerful combo

Careers and development

  • Survey shows hot and cold spots for finance professionals
  • Survey shows hot and cold spots for finance professionals
  • Learning about leadership from Obama
  • Get more from your enterprise performance management

News and announcements

  • More news and events by global region
  • European Shared Services & Outsourcing Week: member discount
  • CIMA sponsors FT Global Outsourcing and Offshoring Conference - discount for members
  • Up to 50% off selected Mastercourses
  • How to become a member of CPA or CMA
  • Enrol on the Fastrack ACT qualification (members only)
  • Certificate in Islamic Finance
  • CIMA warns small businesses not to lose sight of strategy
  • New members’ handbook focuses on accountants in business
  • Namibia moves to address shortage of accountants
  • Survey to boost best practice in financial control
  • Is your marketing profitable? One day conference
  • CIMA Online courses - special offer
  • How to generate cash by optimising your working capital
  • CIMA warns small businesses not to lose sight of strategy
  • Do you do Web 2.0?
  • Supporting accountants in creating sustainable value
  • Credit crunch: problems and opportunities for SMEs

Explore cimaglobal.com

Why you should choose CIMA

Contact us

Email: cima.contact@cimaglobal.com

Or find your local CIMA office
Global Business Challenge Find out more

Study with us

  • Why choose CIMA?
  • How to start CIMA
  • CIMA course providers
  • Exemptions
  • CIMA Certificate in Business Accounting
  • CIMA Professional Qualification
  • Islamic finance qualifications

Students

  • Exam preparation
  • Certificate exam information
  • Professional exam information
  • Practical experience requirements
  • Fees
  • Professional development
  • Exam award listings
  • Student e-magazine

Members

  • Becoming a member
  • Getting the CGMA designation
  • Fees and payment
  • CIMA professional development
  • Members' handbook
  • Find a CIMA accountant
  • New members
  • Monitoring of members working as practising accountants
  • Member FAQs

CIMA in business

  • CIMA value in the private sector
  • CIMA value in the public sector
  • CIMA value in growing businesses
  • CIMA Training and Development Accreditation
  • CGMA

About us

  • Why CIMA?
  • Our mission, behaviours and strategy
  • Celebrating 90 years
  • CIMA case studies and profiles
  • Governance, charter and byelaws
  • Press office
  • Advertise with us
  • Partners
  • Jobs at CIMA
  • What is management accounting?
  • 2012 annual review

© CIMA

  • FAQs
  • Contact Us
  • Terms & conditions
  • Privacy policy
  • Cookie policy
  • Sitemap
  • Accessibility
  • Back to top [Accesskey '5']