Excel

TheSmallman.com

an XL ideas Lab

Dashboards VBA
  • Home
  • Dashboards
    • Tips & Tricks
    • Charts
    • Modelling
    • Infographics
    • VBA
  • Shop Dashboards
    • Power Pivot a User Guide
    • Excel Dashboard Course
    • Advanced Dashboard Course
    • Financial Modelling Course
    • Excel VBA Course
  • Blog
  • About
Menu

Excel Dashboards VBA

Street Address
City, State, Zip
Phone Number
an XL ideas Lab

Your Custom Text Here

Excel Dashboards VBA

  • Home
  • Dashboards
  • Excel Tips
    • Tips & Tricks
    • Charts
    • Modelling
    • Infographics
    • VBA
  • Shop Dashboards
  • PowerPivot
    • Power Pivot a User Guide
  • Courses
    • Excel Dashboard Course
    • Advanced Dashboard Course
    • Financial Modelling Course
    • Excel VBA Course
  • Blog
  • About

XLookup to the Party

August 31, 2019 Marcus Small
XLOOKUP



Microsoft have finally done it… created the XLOOKUP. The Index match versus VLOOKUP argument has been one that has boiled for a while now.  Now the XLOOKUP function will lookup in multiple directions and more. With the newest lookup feature the default is an exact match unlike VLOOKUP where you have to specify the match type which let’s be clear was mostly the exact match anyways.


The Syntax (very important) is as follows:

XLOOKUP( Lookup_value, Lookup_array, Return_array, [match_mode] , [match_mode] )

▲ Lookup_value – value to lookup

▲ Lookup_array – lookup column, the column where the lookup value is stored.

▲ [Not found] - [optional] Return value to return if no match found.

▲ Return_array – return column, what you are looking to return

▲ [match_mode] – 0 for exact match by default.

XLookup Excel example

▲ [match_mode] – 1 for first to last match.

XLookup

The last two arguments in square brackets are optional.

The XLOOKUP will quickly become the default when attempting to find items in a table or range by row. In the following example, look up the cost centre (CC) based on the country.

XLOOKUP Excel

=XLOOKUP(C2,C5:C13,B5:B13)

So the formula asks for:

▲ What you are looking for, cell to look up.

▲ Where that cell is found in a list (range)

▲ The corresponding list, same row, different column.

If the item can not be found NA is returned. This is a departure from VLOOKUP where 0 or FALSE would need to be entered as the fourth argument.

The following example looks in column D for the grade entered in cell C2 and finds a matching marking grade in column C. It uses the match_mode argument set to 1, which means that the function will look for an what is know as an exact match, in the event where there is no match returned, it will return the next larger item.

Grade XLOOKUP

In the Example above 82 is the figure searched for, as 82 falls after 80 but before the 85 then A will be returned for the grade. The formula is as follows.

=XLOOKUP(C2,C5:C12,D5:D12,1,1)

Where C2 is the lookup item.

▲ Where C2 is the lookup item.

▲ Cells C5 to C12 is where the mark hierarchy is.

▲ Cells C5 to C12 contain the appropriate grade.

▲ 1 for an exact match or next smallest item.

▲ 1 search first to last (This is the same as VLOOKUP where it tries to find an exact match starting at the very top and working down the list.

Enjoy working with XLOOKUP - you might have to wait a little while till everyone is on board but it will be worth it in the end.

Tags Xlookup, Excel
← COGS and Sales DashboardPopulate a Userform with VBA →

Featured Posts

Excel Dashboards: Tracking a Crisis

Excel Dashboards: Tracking a Crisis
April 14, 2020

Recent Posts

Populating an Excel Table from a Range of Cells with VBA

Populating an Excel Table from a Range of Cells with VBA June 12, 2025

Fuzzy Distribution with Randbetween

Fuzzy Distribution with Randbetween May 21, 2025

Add Minimum and Maximum for Chart in Cells

Add Minimum and Maximum for Chart in Cells March 12, 2025

Inflation Over Multiple Years in a Single Cell

Inflation Over Multiple Years in a Single Cell January 10, 2025

Hubspot Dashboard

Hubspot Dashboard October 3, 2024

Monthly Dashboard With Supporting Metrics

Monthly Dashboard With Supporting Metrics September 25, 2024

Excel Show Missing Sheet Tabs

Excel Show Missing Sheet Tabs July 29, 2024

Run Macro Overnight Automatically

Run Macro Overnight Automatically June 24, 2024

Split File into Parts and Save to Directory

Split File into Parts and Save to Directory April 20, 2024

Most Popular Author

Most Popular Author December 14, 2023

 

Follow US:

 
 

MarcusSmall@thesmallman.com

 

TheSmallman.com - Making your small systems hum...
© Copyright 2013-2024 theSmallman.com All Rights Reserved.