The XLOOKUP Function
Microsoft

The XLOOKUP Function

Many excel users face a problem when extracting data when using VLOOKUP /HLOOKUP Functions, as these functions have the following limitations

1.     It only searches in First Column/Row, so sometimes you need to rearrange your Data

2.     It extracts columns only to the right of the Lookup Column or Below Lookup Row

3.     It only extracts data from one column/one row which is specified by a number

4.     Column index/Row index is a number, where you might simply count it wrong and get wrong results

5.     Lookup is done from Top to bottom & only first match is extracted

These limitations are solved by the new XLOOKUP function (currently available to office 365 users), XLOOKUP has a very simple syntax (Lookup value, Lookup array/range, return array/range, if not found, match type, search mode), I highly Recommend you learn & practice this function

Ill explain them one by one,

1.     lookup value is the value that you are searching

2.     Lookup array is the array in which the search is to be performed

3.     Return array is the array from which the data to be extracted

4.     If not found, in case your lookup value is not found in lookup array, you can specify some text/number to be returned instead of #N/A

5.     Match type, it is a number (-1,0,1,2), below list explains (from Microsoft support page), most of the times you will use only 0 or exact match

0 Exact match. If none found, return #N/A. This is the default.

-1 Exact match. If none found, return the next smaller item.

1 Exact match. If none found, return the next larger item.

2 A wildcard match

6.     Search mode, it is a number (-2,-1,1,2), you can simply ignore it, but below are the details which are self explanatory (from Microsoft support page)

 1 Perform a search starting at the first item. This is the default.

-1 Perform a reverse search starting at the last item.

2 Perform a binary search that relies on lookup array being sorted in ascending order. If not sorted, invalid results will be returned.

-2 Perform a binary search that relies on lookup array being sorted in descending order. If not sorted, invalid results will be returned.


Below snapshot for extracting customer name from sales table and the lookup is Customer code, you can see in the example that the lookup column is not the first column as opposed to using VLOOKUP where lookup always should be first column & Return Array is also to the left of the Lookup array , which is not possible in VLOOKUP

Start

No alt text provided for this image

Final

No alt text provided for this image


要查看或添加评论,请登录

Chahine Atallah的更多文章

  • Protect Specific Ranges in Excel

    Protect Specific Ranges in Excel

    Assume you have one Excel file & multiple users are updating this file, but each user has to update his fields/cells…

    1 条评论
  • Excel File Protection

    Excel File Protection

    As followup to my previous article, there are many forms of protection to the workbook/Excel File, like mark document…

  • Protecting your worksheets & Workbooks

    Protecting your worksheets & Workbooks

    How to protect worksheets properly? first there is a difference between protecting worksheets & protecting workbooks…

  • Custom formatting in excel (few guidlines)

    Custom formatting in excel (few guidlines)

    Do you know about custom formatting in excel, for example positive numbers to be green, negative numbers in red , zeros…

  • Convert Function

    Convert Function

    Did you ever want to convert from one unit to a different one There is a ready-made excel function called convert, you…

  • Dynamic Arrays (Filter Function)

    Dynamic Arrays (Filter Function)

    Most of our time in excel we use Filter & Sort, but the conventional filter in excel has some limitations , "or"…

  • Pivot Table Tips

    Pivot Table Tips

    Pivot tables one of the most useful feature in excel , ill share some useful tips which might be beneficial to you…

    1 条评论
  • Aggregate Function

    Aggregate Function

    One of the cool functions in Excel is the aggregate function, actually it includes many functions (19 functions ) in…

  • Counting Blank Cells

    Counting Blank Cells

    How do you usually count blank cells in excel? i think most use the count blank function, but there is one issue in…

    1 条评论
  • Flash Fill in Excel

    Flash Fill in Excel

    We have Got times when we need to extract specific data from certain columns, usually we do it either by using "split…

    2 条评论

社区洞察

其他会员也浏览了