{"id":52450,"date":"2025-03-11T09:00:00","date_gmt":"2025-03-11T08:00:00","guid":{"rendered":"https:\/\/blog.sheetgo.com\/?p=52450"},"modified":"2025-06-03T22:07:13","modified_gmt":"2025-06-03T20:07:13","slug":"dominando-a-formula-xlookup-4-casos-de-uso-com-exemplos-reais","status":"publish","type":"post","link":"https:\/\/www.sheetgo.com\/pt\/blog\/google-sheets-features\/mastering-the-xlookup-formula-4-use-cases-with-real-life-examples\/","title":{"rendered":"Dominando a f\u00f3rmula XLOOKUP: 4 casos de uso com exemplos reais"},"content":{"rendered":"\n[et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_row _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; min_height=&#8221;232.6px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p>The XLOOKUP formula in Excel and Google Sheets is a powerful alternative to VLOOKUP. While VLOOKUP works well for many cases, it has limitations: it only searches from left to right, requires a fixed column index, and struggles with dynamic lookups. In contrast, XLOOKUP is flexible, supports searches in any direction, and simplifies data management.<\/p>\n<p>In this blog, we\u2019ll explore four practical scenarios where XLOOKUP shines, especially where VLOOKUP falls short.<\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; min_height=&#8221;382px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h3><b>1. Dynamic Inventory Lookup<\/b><\/h3>\n<p>Scenario: A warehouse manager needs to look up product stock levels and reorder thresholds. If stock is below the reorder threshold, the system should return &#8220;Reorder Needed.&#8221;<\/p>\n<p><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>A<\/b><\/td>\n<td><b>B<\/b><\/td>\n<td><b>C<\/b><\/td>\n<td><b>D<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>Product Code<\/b><\/td>\n<td><b>Product Name<\/b><\/td>\n<td><b>Stock<\/b><\/td>\n<td><b>Reorder Threshold<\/b><\/td>\n<\/tr>\n<tr>\n<td>P001<\/td>\n<td>Product A<\/td>\n<td>50<\/td>\n<td>60<\/td>\n<\/tr>\n<tr>\n<td>P002<\/td>\n<td>Product B<\/td>\n<td>30<\/td>\n<td>20<\/td>\n<\/tr>\n<tr>\n<td>P003<\/td>\n<td>Product C<\/td>\n<td>10<\/td>\n<td>15<\/td>\n<\/tr>\n<\/tbody>\n<\/table>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p>=XLOOKUP(F5, $A$4:$A$14, $C$4:$C$14, &#8220;Not Found&#8221;)<\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; min_height=&#8221;382px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<table>\n<tbody>\n<tr>\n<td><b>F<\/b><\/td>\n<td><b>G<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>Product Code<\/b><\/td>\n<td><b>Stock<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>P002<\/b><\/td>\n<td><b>30<\/b><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>Formula breakdown:<\/b><\/p>\n<ol>\n<li><b>F5<\/b>: Lookup value (Product Code).<\/li>\n<li><b>$A$4:$A$14<\/b>: Lookup array (Product Codes).<\/li>\n<li><b>$C$4:$C$14<\/b>: Return array (Stock levels).<\/li>\n<li>&#8220;Not Found&#8221;: Default message if the Product Code doesn\u2019t exist.<\/li>\n<\/ol>\n<p><b>Where VLOOKUP Fails<\/b>:<\/p>\n<ul>\n<li>VLOOKUP requires the lookup column to be the first column, making it rigid.<\/li>\n<li>XLOOKUP allows searching any column for a match.<\/li>\n<\/ul>\n<p>Advanced Usage: Check if stock is below reorder levels:<\/p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; min_height=&#8221;90px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p>=IF(XLOOKUP(F5, $A$4:$A$14, $C$4:$C$14) &lt; XLOOKUP(F5, $A$4:$A$14, $D$4:$D$14), &#8220;Reorder Needed&#8221;, &#8220;Sufficient Stock&#8221;)<\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; min_height=&#8221;229px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>F<\/b><\/td>\n<td><b>G<\/b><\/td>\n<td><b>H<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>Product Code<\/b><\/td>\n<td><b>Stock<\/b><\/td>\n<td><b>Result<\/b><\/td>\n<\/tr>\n<tr>\n<td>P002<\/td>\n<td>30<\/td>\n<td>Sufficient Stock<\/td>\n<\/tr>\n<tr>\n<td>P003<\/td>\n<td>10<\/td>\n<td>Reorder Needed<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><i><\/i><\/p>\n<p><a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1-BzJkzO3H4lM-swjYtOKmtqgEkvZR_VD4EL7Eb6NFEg\/copy?gid=403646787#gid=403646787\" target=\"_blank\" rel=\"noopener\">Check the formula in the spreadsheet<\/a><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; min_height=&#8221;382px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h3><b>2. Employee Lookup Across Multiple Sheets<\/b><\/h3>\n<p>Scenario: An HR team manages employee records across multiple sheets. They need a tool to search for an employee&#8217;s department and salary dynamically.<\/p>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>A<\/b><\/td>\n<td><b>B<\/b><\/td>\n<td><b>C<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>Employee ID<\/b><\/td>\n<td><b>Department<\/b><\/td>\n<td><b>Salary ($)<\/b><\/td>\n<\/tr>\n<tr>\n<td>E101<\/td>\n<td>Marketing<\/td>\n<td>$5,000.0<\/td>\n<\/tr>\n<tr>\n<td>E102<\/td>\n<td>IT<\/td>\n<td>$6,500.0<\/td>\n<\/tr>\n<tr>\n<td>E103<\/td>\n<td>HR<\/td>\n<td>$4,800.0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; min_height=&#8221;51px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p>=XLOOKUP(F5, $A$4:$A$14, $B$4:$B$14, &#8220;Not Found&#8221;)<\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; min_height=&#8221;382px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><b>Formula breakdown:<\/b><\/p>\n<ol>\n<li><b>F5<\/b>: Employee ID being searched.<\/li>\n<li><b>A4<\/b>**:A14**: Lookup array (Employee IDs).<\/li>\n<li><b>B4<\/b>**:B14**: Return array (Departments).<\/li>\n<li>&#8220;Not Found&#8221;: Displays message if an Employee ID is not found.<\/li>\n<\/ol>\n<p><b>Why XLOOKUP Wins:<\/b><\/p>\n<ul>\n<li>VLOOKUP cannot search backward or in columns to the left.<\/li>\n<li>XLOOKUP can return results dynamically, even from adjacent or non-adjacent columns.<\/li>\n<\/ul>\n<table>\n<tbody>\n<tr>\n<td><b>F<\/b><\/td>\n<td><b>G<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>Employee ID<\/b><\/td>\n<td><b>Department<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>E101<\/b><\/td>\n<td><b>Marketing<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>E103<\/b><\/td>\n<td><b>HR<\/b><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>To fetch the salary instead, update the return array<\/p>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; min_height=&#8221;55px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p>:=XLOOKUP(F5, $A$4:$A$14, $C$4:$C$14, &#8220;Not Found&#8221;)<\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; min_height=&#8221;382px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1-BzJkzO3H4lM-swjYtOKmtqgEkvZR_VD4EL7Eb6NFEg\/copy?gid=632321386#gid=632321386\" target=\"_blank\" rel=\"noopener\"><i>Check the formula <\/i><i>in the spreadsheet<\/i><\/a><\/p>\n<h3><b>3. Combining First and Last Names<\/b><\/h3>\n<p>Scenario: A manager wants to find a full name from a list of employees by combining first and last names dynamically.<\/p>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>A<\/b><\/td>\n<td><b>B<\/b><\/td>\n<td><b>C<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>Employee ID<\/b><\/td>\n<td><b>First Name<\/b><\/td>\n<td><b>Last Name<\/b><\/td>\n<\/tr>\n<tr>\n<td>E001<\/td>\n<td>John<\/td>\n<td>Smith<\/td>\n<\/tr>\n<tr>\n<td>E002<\/td>\n<td>Jane<\/td>\n<td>Doe<\/td>\n<\/tr>\n<tr>\n<td>E003<\/td>\n<td>Mike<\/td>\n<td>Brown<\/td>\n<\/tr>\n<\/tbody>\n<\/table>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; min_height=&#8221;54px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p>=ArrayFormula(XLOOKUP($F$5:$F$14, $A$4:$A$14, $B$4:$B$14 &amp; &#8221; &#8221; &amp; $C$4:$C$14,&#8221;&#8221;))<\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; min_height=&#8221;312px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><b>Formula breakdown:\u00a0<\/b><\/p>\n<ol>\n<li><b>ArrayFormula<\/b>: Ensures the formula works across multiple rows dynamically without dragging it down.<\/li>\n<li><b>F5:F14: <\/b>Range of Employee IDs to look up.<\/li>\n<li><b>A4:A14:<\/b> Lookup array (Employee IDs).<\/li>\n<li><b>B4:B14 &amp; &#8221; &#8221; &amp; C4:C14: <\/b>Combines First and Last Names dynamically.<\/li>\n<li>&#8220;&#8221;: Displays blank if an Employee ID is not found.<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td><b>F<\/b><\/td>\n<td><b>G<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>Employee ID<\/b><\/td>\n<td><b>Full Name<\/b><\/td>\n<\/tr>\n<tr>\n<td>E001<\/td>\n<td>John Smith<\/td>\n<\/tr>\n<tr>\n<td>E003<\/td>\n<td>Mike Brown<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>Why XLOOKUP Excels<\/b>:<\/p>\n<ul>\n<li>It allows combining values dynamically without creating additional columns.<\/li>\n<li>VLOOKUP would require a helper column to merge first and last names.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1-BzJkzO3H4lM-swjYtOKmtqgEkvZR_VD4EL7Eb6NFEg\/copy?gid=1424718872#gid=1424718872\" target=\"_blank\" rel=\"noopener\">Check the formula in the spreadsheet<\/a><\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; min_height=&#8221;275px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<h3><b>4. Finding the Latest Sales Record<\/b><\/h3>\n<p><b>Scenario: A sales manager wants to find the most recent sales amount for a specific salesperson.<\/b><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>A<\/b><\/td>\n<td><b>B<\/b><\/td>\n<td><b>C<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>Salesperson<\/b><\/td>\n<td><b>Date<\/b><\/td>\n<td><b>Sales ($)<\/b><\/td>\n<\/tr>\n<tr>\n<td>Alice<\/td>\n<td>1\/1\/2024<\/td>\n<td>$1,000.0<\/td>\n<\/tr>\n<tr>\n<td>Bob<\/td>\n<td>1\/2\/2024<\/td>\n<td>$1,500.0<\/td>\n<\/tr>\n<tr>\n<td>Alice<\/td>\n<td>1\/3\/2024<\/td>\n<td>$2,000.0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><\/h3>[\/et_pb_text][et_pb_text module_class=&#8221;spreadsheet-function&#8221; _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; min_height=&#8221;53px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p>=XLOOKUP(F5, $A$4:$A$14, $C$4:$C$14, &#8220;Not Found&#8221;, 0, -1)<\/p>[\/et_pb_text][et_pb_text _builder_version=&#8221;4.27.2&#8243; _module_preset=&#8221;default&#8221; min_height=&#8221;275px&#8221; global_colors_info=&#8221;{}&#8221; theme_builder_area=&#8221;post_content&#8221;]<p><a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1-BzJkzO3H4lM-swjYtOKmtqgEkvZR_VD4EL7Eb6NFEg\/copy?gid=1305858591#gid=1305858591\" target=\"_blank\" rel=\"noopener\">Check the formula in the spreadsheet<\/a><\/p>\n<h4><b>Formula breakdown:<\/b><\/h4>\n<ol>\n<li><b>F5: <\/b>Range of Salesperson name to look up.<\/li>\n<li><b>A4:A14<\/b>: Lookup array (Salesperson names). The $ symbol is used to lock both the column and the row.<\/li>\n<li><b>&#8220;Not Found&#8221;<\/b>: Default message if the Salesperson name doesn\u2019t exist.<\/li>\n<li><b>C4:C14<\/b>: Return array (Sales amounts).<\/li>\n<li><b>0<\/b>: Exact match.<\/li>\n<li><b>-1<\/b>: Searches from the bottom up to return the latest match.<\/li>\n<\/ol>\n<table>\n<tbody>\n<tr>\n<td><b>F<\/b><\/td>\n<td><b>G<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>Salesperson<\/b><\/td>\n<td><b>Latest Sales<\/b><\/td>\n<\/tr>\n<tr>\n<td>Alice<\/td>\n<td>$2,000.0<\/td>\n<\/tr>\n<tr>\n<td>Bob<\/td>\n<td>$1,500.0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1-BzJkzO3H4lM-swjYtOKmtqgEkvZR_VD4EL7Eb6NFEg\/copy?gid=416321638#gid=416321638\" target=\"_blank\" rel=\"noopener\">Check the formula in the spreadsheet<\/a><\/p>\n<p><b>Why XLOOKUP Excels:<\/b><\/p>\n<ul>\n<li>Unlike VLOOKUP, XLOOKUP can search from bottom to top using the optional <b>search mode (-1)<\/b>.<\/li>\n<li>VLOOKUP cannot natively find the latest record without sorting data manually.<\/li>\n<\/ul>\n<h3><b>Unlock the Power of XLOOKUP<\/b><\/h3>\n<p>XLOOKUP is a game-changer for dynamic lookups, offering flexibility and solving VLOOKUP\u2019s limitations. Whether you\u2019re handling inventory, managing HR data, or analyzing sales records, XLOOKUP simplifies your workflows and improves accuracy.<\/p>\n<p><b>Why Use XLOOKUP Instead of VLOOKUP?<\/b><\/p>\n<ul>\n<li>Search in any direction (left, right, top, bottom).<\/li>\n<li>No need for fixed column indexes.<\/li>\n<li>Handles missing values gracefully with customizable defaults.<\/li>\n<li>Allows dynamic and combined lookups.<\/li>\n<\/ul>\n<p>Have your own XLOOKUP use case? Share it in the comments below and let us know how this versatile formula has enhanced your data management!<\/p>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]\n","protected":false},"excerpt":{"rendered":"<p>The XLOOKUP formula in Excel and Google Sheets is a powerful alternative to VLOOKUP. While VLOOKUP works well for many cases, it has limitations: it only searches from left to right, requires a fixed column index, and struggles with dynamic lookups. In contrast, XLOOKUP is flexible, supports searches in any direction, and simplifies data management. [&hellip;]<\/p>\n","protected":false},"author":46,"featured_media":44470,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[37],"tags":[],"class_list":["post-52450","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-google-sheets-features"],"acf":[],"permalink_manager":null,"_links":{"self":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/52450","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/users\/46"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/comments?post=52450"}],"version-history":[{"count":0,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/posts\/52450\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media\/44470"}],"wp:attachment":[{"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/media?parent=52450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/categories?post=52450"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sheetgo.com\/pt\/wp-json\/wp\/v2\/tags?post=52450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}