VLOOKUP vs XLOOKUP vs INDEX+MATCH vs FILTER — When to Use Each

Excel has multiple ways to perform lookups. They solve similar problems, but each is better in different situations.


Quick Comparison

FunctionBest ForKey LimitationReturns Multiple Matches?Works in Old Excel?
XLOOKUPModern default lookupExcel 365 / 2021+ only❌ No
VLOOKUPLegacy spreadsheetsLookup column must be first❌ No
INDEX+MATCHFlexible, backward compatibleMore complex to write❌ No
FILTERReturning all matchesExcel 365 / 2021+ only✅ Yes

Important Behavior (All Lookups)

By default:

  • XLOOKUP
  • VLOOKUP
  • INDEX+MATCH

…return the first occurrence of a match.

You can make XLOOKUP return the last occurrence using:

search_mode = -1

But if you need every match, none of these are correct → use FILTER.


Use XLOOKUP (Default Choice)

=XLOOKUP(A2, A:A, D:D)

Use when:

  • You’re in Excel 365 / 2021+
  • You want the cleanest, simplest formula
  • You don’t want to count column indexes
  • You want better built-in error handling

XLOOKUP is designed to replace VLOOKUP and HLOOKUP.


Use VLOOKUP (Legacy Only)

=VLOOKUP(A2, A:D, 4, FALSE)

Use when:

  • You’re maintaining old spreadsheets
  • XLOOKUP is not available

Limitations:

  • Lookup column must be first
  • Breaks when columns move
  • Requires column index numbers

Use INDEX + MATCH (Power + Compatibility)

=INDEX(D:D, MATCH(A2, A:A, 0))

Use when:

  • You’re in Excel 2019 or earlier
  • You need flexibility VLOOKUP can’t provide
  • You want a dynamic lookup that doesn’t break when columns move
  • You’re working with large datasets (50,000+ rows)

INDEX+MATCH works in every version of Excel and does not require Microsoft 365.

Functionally, INDEX+MATCH and XLOOKUP achieve the same result in different ways.


Use FILTER (Return All Matches)

=FILTER(A:D, A:A=A2)

Use when:

  • A value appears multiple times
  • You need every matching row returned
  • You’re in Excel 365 / 2021+

This is something XLOOKUP, VLOOKUP, and INDEX+MATCH cannot do.


Summary — When to Use Each

  • XLOOKUP → Modern, easiest, default choice
  • VLOOKUP → Only for legacy files
  • INDEX+MATCH → Best for compatibility and flexibility
  • FILTER → When you need multiple matching results

For modern Excel: XLOOKUP first, FILTER when needed.
For older Excel: INDEX+MATCH over VLOOKUP.

INDEX + MATCH in Excel — Crash Course

INDEX+MATCH is a powerful lookup pattern used for flexible, dynamic lookups in Excel.
You’ll often hear it said as “INDEX+MATCH”, but in practice it’s really MATCH inside INDEX.

You can use XLOOKUP instead in modern Excel. They achieve similar results with different tradeoffs.


When to Use INDEX + MATCH

Use INDEX+MATCH when:

  • The lookup column is not the first column
  • You want a dynamic, non-breaking lookup
  • You want more control than VLOOKUP allows
  • You’re working in older Excel versions without XLOOKUP

MATCH — Finds the Position (Row Number)

MATCH returns the position of a value inside a single column (or row).

Syntax

MATCH(lookup_value, lookup_array, match_type)
  • lookup_value → what you’re searching for
  • lookup_array → must be one column or one row
  • match_type → usually 0 for exact match

Important Rules

  • Output is 1-indexed
  • The row number depends on the size of the range

Example

If value is in C10:

  • MATCH("Apples", C1:C20, 0) → 10
  • MATCH("Apples", C10:C20, 0) → 1

Same cell, different output because the range changed.


INDEX — Returns the Value at a Position

INDEX returns a value from a table based on row (and optionally column).

Syntax

INDEX(array, row_num, [column_num])

Instead of hardcoding row_num, you place the MATCH function here.


Basic INDEX + MATCH Example

Example Table

ProductPrice
Apples2.50
Oranges3.00
Carrots1.80

Goal: Find the Price of “Carrots”.

=INDEX(B2:B4, MATCH("Carrots", A2:A4, 0))

What happens:

  1. MATCH finds the row where “Carrots” exists
  2. INDEX returns the price from that row

The lookup and return columns are different — this is the power.


Critical Rule: Ranges Must Align

The MATCH range and INDEX range must cover the same rows.

If MATCH returns row 3, INDEX must also have a 3rd row to pull from.


Advanced: Lookup with Two Criteria (Row + Column)

If you need to find a value based on two parameters (e.g., Cookie Type and Country):

  • Use MATCH twice
  • Use INDEX with both results
=INDEX(Table1,
MATCH(E7, Table1[Cookie Type], 0),
MATCH(E8, Table1[#Headers], 0))

One MATCH finds the row. The other finds the column.


Advanced MATCH: Multiple Criteria with &

You can combine fields to match on multiple conditions.

=MATCH(E7&E8,
Table1[Cookie Type]&Table1[Country],
0)
  • Lookup value: E7&E8
  • Lookup array: combined columns with &

INDEX + MATCH vs XLOOKUP

Both solve the same problem.

  • INDEX+MATCH → more manual control, works everywhere
  • XLOOKUP → simpler syntax, modern Excel

Key Takeaways

  • MATCH finds the position
  • INDEX returns the value at that position
  • MATCH must use a single row/column
  • INDEX and MATCH ranges must align
  • You can use two MATCH functions for two criteria
  • You can combine fields with & for multi-condition matching

XLOOKUP vs VLOOKUP in Excel (The Right Way to Do Lookups)

If XLOOKUP exists in your version of Excel, you should almost always use it instead of VLOOKUP. It’s simpler, safer, and doesn’t break when your table changes.


Simple Example Table

Product NameCategoryPriceBoxes Shipped
ApplesFruit2.50120
OrangesFruit3.0095
CarrotsVeggie1.80150
BananasFruit2.20130

Goal: Look up a Product Name and return Boxes Shipped.

Assume the product you’re searching for is in cell F2.


The VLOOKUP Way (Old Method)

=VLOOKUP(F2, A:D, 4, FALSE)
  • F2 → product name to find
  • A:D → table range
  • 4 → Boxes Shipped column
  • FALSE → exact match

The Problem with VLOOKUP

  • Lookup column must be first
  • You must count column positions
  • Insert a column → formula breaks
  • Not flexible

The XLOOKUP Way (Modern Method)

=XLOOKUP(F2, A:A, D:D)
  • Lookup column does not need to be first
  • No column index numbers
  • Easier to read and maintain

Best Practice: Convert to an Excel Table (Ctrl + T)

Convert the data into a Table. Assume the table is named Table1.

Best Formula You Can Write

=XLOOKUP(F2, Table1[Product Name], Table1[Boxes Shipped])

Why this is best:

  • Expands automatically when rows are added
  • Doesn’t break if columns move
  • Uses names instead of positions
  • Fully dynamic

This is what advanced Excel users do.


If You Are Forced to Use VLOOKUP

You can still improve it with structured references:

=VLOOKUP(F2, Table1, 4, FALSE)

But you still depend on column positions.


Strong Alternative: INDEX + MATCH

=INDEX(Table1[Boxes Shipped], MATCH(F2, Table1[Product Name], 0))

Dynamic and very reliable.


References: Relative vs Absolute vs Table

TypeExampleProblem
RelativeA2:D6Breaks when dragged
Absolute$A$2:$D$6Breaks when rows change
TableTable1[Product Name]Auto-updates (best)

Press F4 to make a reference absolute.


Common Lookup Errors

ErrorMeaning
#N/AValue not found
#REF!Column moved/deleted
#VALUE!Wrong input type
#NAME?Misspelled function

Key Takeaways

  • Use XLOOKUP, not VLOOKUP
  • Convert data to a Table
  • Use structured references
  • Avoid column index guessing
  • INDEX/MATCH is still excellent

Excel Counting & Aggregation Functions: Quick Reference

Summary of Functions

FunctionDescription
COUNTCounts the number of cells within the range that have numeric values
COUNTACounts the number of non-empty cells in a range (values can be numbers, text, or dates) (i.e. NOT blank)
COUNTBLANKCounts the number of blank/empty cells in a range
COUNTIFCounts the number of cells meeting a single condition
COUNTIFSCounts number of rows meeting multiple conditions
SUMIFAdds values in a range meeting one condition
SUMIFSAdds values meeting multiple conditions
AVERAGEIFCalculates the average of values meeting a condition

Example Table

NameDepartmentSalesStatus
JohnMarketing100Active
JaneMarketing150Inactive
MikeSales200Active
SaraSales250Active
TomMarketingActive

Basic Counting

COUNT → counts numbers only

=COUNT(C2:C6)  → 4

COUNTA → counts all non-empty cells

=COUNTA(C2:C6) → 4 (counts numeric and text if present)

COUNTBLANK → counts empty cells

=COUNTBLANK(C2:C6) → 1

Conditional Counting

COUNTIF → counts cells that meet one condition

=COUNTIF(B2:B6,"Marketing") → 3
=COUNTIF(D2:D6,"Active") → 4

COUNTIFS → counts cells that meet multiple conditions

=COUNTIFS(B2:B6,"Marketing",D2:D6,"Active") → 2

Conditional Summing

SUMIF → sum values based on one condition

=SUMIF(B2:B6,"Sales",C2:C6) → 450

SUMIFS → sum values based on multiple conditions

=SUMIFS(C2:C6,B2:B6,"Marketing",D2:D6,"Active") → 100

Conditional Average

AVERAGEIF → average values based on a condition

=AVERAGEIF(B2:B6,"Marketing",C2:C6) → 125

Key Takeaways

  • COUNT / COUNTA / COUNTBLANK → basic counting of numbers, non-empty, or blank cells
  • COUNTIF / COUNTIFS → count based on one or more conditions
  • SUMIF / SUMIFS → sum values conditionally
  • AVERAGEIF → average values based on a condition
  • Use these functions for quick data aggregation, reporting, and analytics

Excel IF, IFERROR, IFNA, and IFS — When and How to Use Each

Logical functions are essential in Excel for data cleaning, reporting, and analytics. These four functions help you apply logic and handle errors cleanly:

  • IF → basic logic
  • IFS → multiple conditions
  • IFERROR → catch any error
  • IFNA → catch only #N/A

IF — Basic Logical Test

Use IF when you want Excel to return different results based on a condition.

=IF(A2>50,"Pass","Fail")

Structure

IF(logical_test, value_if_true, value_if_false)

Common uses: thresholds, flags, labels, categories.


IFS — Multiple Conditions (Cleaner than Nested IFs)

Use IFS when you have many conditions to check.

Instead of nested IFs:

=IF(A2>90,"A",IF(A2>80,"B",IF(A2>70,"C","D")))

Use:

=IFS(
A2>90,"A",
A2>80,"B",
A2>70,"C",
TRUE,"D"
)

Cleaner and easier to read.


IFERROR — Handle Any Excel Error

Use IFERROR to replace any error (#DIV/0!#N/A#VALUE!, etc.).

=IFERROR(A2/B2,"Error")

Structure

IFERROR(value, value_if_error)

Common in calculations, lookups, and formulas that might break.


IFNA — Handle Only #N/A Errors

Use IFNA when working with lookups and you only want to catch missing matches.

=IFNA(VLOOKUP(A2,Sheet2!A:B,2,FALSE),"Not Found")

This keeps other errors visible while handling only #N/A.

Structure

IFNA(value, value_if_na)

When to Use Each

FunctionUse When
IFYou have one condition
IFSYou have multiple conditions
IFERRORYou want to hide all errors
IFNAYou only want to handle missing lookup results

Common Analytics Examples

Categorize values

=IF(A2>=100,"High","Low")

Grade ranges

=IFS(A2>=90,"A", A2>=80,"B", TRUE,"C")

Safe division

=IFERROR(A2/B2,0)

Lookup with fallback

=IFNA(XLOOKUP(A2,A:A,B:B),"Missing")

Key Takeaways

These are core functions for data cleaning and reporting in Excel

  • IF handles simple logic
  • IFS replaces nested IF statements
  • IFERROR hides all errors
  • IFNA hides only #N/A from lookups

Excel Formulas vs Functions: A Fast Beginner Guide

If you’re using Excel for data analytics, reporting, or general data work, understanding formulasfunctions, and cell references is essential. These are the building blocks behind almost every spreadsheet.


What Is a Formula?

formula is a calculation you write yourself using:

  • Numbers
  • Cell references
  • Math operators: + - * /

All formulas start with =.

Examples:

=B2+B3
=B2-B3
=B2*B3
=B2/B3

Cell References vs Hardcoding Numbers

Avoid hardcoding:

=10+20

Use cell references:

=B2+B3

This makes your spreadsheet dynamic. When values change, the result updates automatically.


What Is a Function?

function is a built-in formula Excel provides to simplify common calculations.

Example:

=SUM(B2:B5)

Key idea:
Every function is a formula. Not every formula is a function.


When to Use Functions

Instead of:

=B2+B3+B4+B5

Use:

=SUM(B2:B5)

Functions are cleaner, faster, and reduce errors.


Essential Excel Functions

SUM – Add values

=SUM(B2:B5)

AVERAGE – Calculate the mean

=AVERAGE(B2:B5)

MAX – Largest value

=MAX(B2:B5)

MIN – Smallest value

=MIN(B2:B5)

COUNT – Count numeric cells

=COUNT(B2:B5)

IF – Apply logic

=IF(B2>50,"Pass","Fail")

Relative vs Absolute Cell References

  • B2 → Relative reference (changes when dragged)
  • $B$2 → Absolute reference (stays fixed when dragged)

This matters when copying formulas across rows or columns.


Explore Excel’s Function Library

Go to Formulas → Insert Function to browse Excel’s full function library and get help building formulas.


Key Takeaways

Understand absolute vs relative references when copying formulas

Formulas start with = and use cell references

Functions are built-in formulas like SUMIFAVERAGE

Always reference cells instead of hardcoding numbers

Use functions to simplify calculations

Excel: Convert Dates from DD MM YYYY to MM DD YYYY (Fix Text Dates Fast)

Intro / The Problem

You have Excel dates like:

25 12 2024
27 01 2025

Excel treats them as text, not real dates, because the format is DD MM YYYY instead of MM DD YYYY.You can’t sort, filter, use date formulas, or load them correctly into Power BI / Tableau.

You need to convert text to a real Excel date, then format it.


Solution Summarized

  1. Select the column
  2. Data → Text to Columns
  3. Choose Delimited → Next → Next
  4. Set Column Data Format = Date (DMY) → Finish
  5. Ctrl + 1 → Custom format → mm dd yyyy

Solution Steps

Step 1 — Select the Date Column

Highlight the entire column with the DD MM YYYY dates.

Step 2 — Open Text to Columns

Go to Data → Text to Columns and choose Delimited.

Step 3 — Skip Delimiters

Uncheck all delimiters. Click Next.

Step 4 — Set Date Format to DMY

Under Column Data Format, choose Date → DMY. Click Finish.
This converts Excel text to a real date.

Step 5 — Apply Custom Date Format

Press Ctrl + 1 → Custom → type:

mm dd yyyy

How to Verify It Worked

  • =YEAR(A2) returns a year
  • Sorting works correctly
  • Changing to Long Date changes the display
  • Works in Pivot Tables / Power BI

Summary

  • Excel can’t recognize DD MM YYYY dates (when the region of the software is set to U.S.)
  • Formatting alone does not fix text dates
  • Text to Columns (DMY) converts text to a real date
  • Custom format displays as MM DD YYYY

How to Install Python Libraries in Visual Studio Code (Mac)

Before we begin, ensure that you have at least Python 3 installed. I’m using Python 3.9

First, create a new folder. This will be your Python project folder.

Next, create a Python file inside your folder. It doesn’t matter what you call it. I’ll call mine main.py

In order to import libraries inside our folder, we need to first create a Python virtual environment. To do this run the following command in Terminal inside your project directory:

python3.9 -m venv projenv 

I typed python3.9 because I’m using Python 3.9, but you would type whichever version you’re using.

I called my virtual environment projenv, but you can call yours whatever you want.

You should see a new folder for your virtual environment was created within your project folder.

Note: Check to make sure that the VS Code Python interpreter is the correct version.

Next, we will activate the virtual environment so that Terminal knows we only want to work within the virtual environment.

source projenv/bin/activate

Now, you should see the virtual environment name in parentheses at the left of your new Terminal line.

It’s good practice to make sure you have installed the latest version of pip. Run this command to update to latest:

pip3 install --upgrade pip

Now, we can start installing pip dependencies to our project.

To install a dependency, run the following command:

pip3 install matplotlib

I’m using matplotlib in this example.

Now, we will check to to see if the install was successful. In the Python file you created earlier, import the matplotlib package:

import matplotlib.pyplot

Run the main.py file by typing python main.py in Terminal.

If you don’t get an error, then you successfully installed a package!

Top 12 VS Code Extensions

Visual Studio Code Extensions make your workflow so much more efficient and enjoyable in VS Code. This article provides a list of some of my favorite VS Code extensions. There is no ordering from best to worst.

1. Auto Rename Tag

If you change an HTML/XML tag, this extension will automatically update the paired tag.

2. Bracket Pair Colorizer

This extensions’ intuitive colorizing of matching brackets (and parentheses) makes it easier to see where a block starts and ends

3. Live Server

This extension launches a local server with live reload. This extension is great for updating static HTML/CSS/JS files quickly without creating your own server.

4. Prettier

Have you been formatting your code manually? No more. This extension will format your code for you on save.

5. Live Share

Do you want to work on a project with a friend or teammate? This extension allows you to collaborate on a project in VS Code in real-time. Think Google Docs but for code!

6. Quokka.js

This extension allows you to test out JavaScript and TypeScript code on the fly in an in-editor playground.

7. Import Cost

When you import a package into a file in VS Code, this extension will show you how much memory that package takes up.

8. GitLens

This extension allows you to visualize code authorship via Git blame annotations and code lens. You can also navigate in the history of a file back and forth to see the changes that were made on it.

9. Path Intellisense

This extension will auto-complete filenames and file paths for you as you type them.

10. Snippets

This is not a single extension but a collection of extensions that provide code snippets for specific languages and frameworks. Using snippets allows you to not have to type as much. The example I’m showing here is the ES7 React snippets for React developers.

11. Better Comments

This extension augments your ability to create more human-friendly comments in your code. You can categorize your annotations with different colors.

12. VS Code Icons

This extension adds icons to your files in the sidebar so it is easier to tell which is which when there is a lot of files.

Go check out all of these great extensions!

Flutter Error: The argument type ‘String’ can’t be assigned to the parameter type ‘Uri’

The Error

If you are using a string URI when dealing with the http package in Flutter, you may be seeing this error:

The Error
The argument type 'String' can't be assigned to the parameter type 'Uri' at .... (argument_type_not_assignable)

This error is due to an update in the package.

The Solution

Parse the String to be an explicit URI by using the Uri.parse() method:

http.get(yourString) becomes http.get(Uri.parse(yourString))

http.post(yourString) becomes http.post(Uri.parse(yourString))

Here is it in an example:

String dataURL = "https://api.com/users";
http.Response response = await http.get(Uri.parse(dataURL));

To improve compile-time type safety, the http package (version 0.13.0) introduced changes that made all functions that previously accepted Uris or Strings now accept only Uris instead.

You will need to explicitly use Uri.parse to convert Strings to Uris. In the previous version, the http packaged called that for you behind the scenes.