No history yet

Advanced Formulas

Beyond VLOOKUP

Many people are familiar with VLOOKUP, but it has its limitations. It can only search in the leftmost column of a table and can be slow with large datasets. Let's explore two more powerful alternatives for looking up data: INDEX-MATCH and XLOOKUP.

The combination of INDEX and MATCH is a classic Excel power move. It’s more flexible than VLOOKUP because it can look up values in any column and return a corresponding value from any other column, left or right.

Let's break it down. The MATCH function finds the position of a lookup value within a range. For example, MATCH("Banana", A1:A5, 0) would return the row number where "Banana" appears. The INDEX function then retrieves the value at that specific row (and column) from another range.

Here’s how they work together:

=INDEX(return_range, MATCH(lookup_value, lookup_range, 0))

This formula first uses MATCH to find the row number of your lookup_value and then feeds that number into INDEX to pull the corresponding value from the return_range.

Enter XLOOKUP

More recently, Excel introduced XLOOKUP, which simplifies this entire process. It's designed to replace VLOOKUP, HLOOKUP, and INDEX-MATCH with a single, easier-to-use function. It’s powerful, flexible, and more intuitive.

=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])

The first three arguments are all you need for a basic lookup. You provide the value you're looking for, the range to search in, and the range to return from. Unlike VLOOKUP, the lookup and return ranges can be anywhere, and XLOOKUP defaults to an exact match, which is safer.

For example, to find the price of a "Banana" in column B, based on its name in column A:

=XLOOKUP("Banana", A2:A10, B2:B10, "Not Found")

A key advantage is the built-in if_not_found argument. Instead of wrapping your formula in an IFERROR function, you can simply tell XLOOKUP what to return if the value isn't found.

Making Decisions with Logic

Your data analysis often depends on conditions. Excel's logical functions are perfect for these scenarios, letting you perform different actions based on whether a condition is true or false.

The IF function is the foundation of conditional logic in Excel. It checks a condition and returns one value if it's true, and another if it's false.

=IF(logical_test, [value_if_true], [value_if_false])

For example, to check if a sales figure in cell B2 is greater than $500, you could use =IF(B2>500, "High", "Low").

What if you have multiple conditions? You could nest IF functions, but that gets messy. The IFS function is a cleaner solution. It checks multiple conditions in order and returns the value for the first one that is true.

=IFS(test1, value1, test2, value2, ...)

For more complex tests, you can combine IF with AND and OR.

  • AND(test1, test2, ...) returns TRUE only if all its arguments are true.
  • OR(test1, test2, ...) returns TRUE if any of its arguments are true.

Imagine you want to give a bonus if an employee is in the "Sales" department (C2) and has sales over $10,000 (D2). You'd use:

=IF(AND(C2="Sales", D2>10000), "Bonus", "No Bonus")

Working with Text

Data isn't always clean, especially when it comes to text. Excel has powerful functions to split, join, and extract text, saving you from tedious manual editing.

FunctionWhat It Does
TEXTJOINCombines text from multiple ranges with a delimiter.
TEXTSPLITSplits text into rows or columns using a delimiter.
TEXTBEFOREReturns text that occurs before a given delimiter.
TEXTAFTERReturns text that occurs after a given delimiter.

Let's see them in action. Suppose you have a cell (A1) containing "First Name,Last Name".

To split this into two separate cells, you can use TEXTSPLIT:

=TEXTSPLIT(A1, ",")

This will spill "First Name" into the current cell and "Last Name" into the cell to its right.

To extract just the last name, TEXTAFTER is perfect:

=TEXTAFTER(A1, ",")

And if you had first names in column A and last names in column B, you could join them together into a full name with TEXTJOIN:

=TEXTJOIN(" ", TRUE, A2, B2)

The first argument is the delimiter (a space), the second tells Excel to ignore empty cells, and the following arguments are the cells to join. These functions make text manipulation fast and efficient.

Quiz Questions 1/5

What is a primary advantage of using an INDEX-MATCH combination over VLOOKUP?

Quiz Questions 2/5

Which argument in the XLOOKUP function allows you to specify a value to return if the lookup value is not found, eliminating the need for a separate IFERROR function?

Mastering these formulas moves you from a casual user to an Excel power user, ready to tackle complex data challenges.