Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Excel Lookup: How to Fill Another Table Automatically?

Learn how to use Excel formulas like INDEX, MATCH, LET, and LAMBDA to auto-fill summary tables based on lookup logic.
Excel auto-fill summary table using INDEX MATCH LET LAMBDA formulas, showing automated data population from raw data Excel auto-fill summary table using INDEX MATCH LET LAMBDA formulas, showing automated data population from raw data
  • ⚙️ INDEX/MATCH gives you more options and works up to 20% faster than VLOOKUP with lots of data.
  • 🔁 LET and LAMBDA stop you from repeating parts of formulas. This makes your Excel files faster and easier to keep up.
  • 📊 Excel Tables, with their structured names, grow on their own. And this means fewer broken formulas.
  • ⚠️ Problems like mixed data types or extra spaces often stop lookups from working. You need to clean up this data.
  • 🧮 Arrays that change size and XLOOKUP let you get many values or filtered values, and with simpler code.

How to Fill Excel Tables Automatically with Lookups: A Guide for Developers

Excel is a strong and adaptable tool for developers and people who work with data. They use it to handle raw data and summary reports. When you have raw logs or data feeds, you often need to automatically fill a structured table. This could be a dashboard or report, using details from a separate, bigger dataset. This guide will look at advanced Excel formulas and methods. We will cover INDEX-MATCH, LET, LAMBDA, XLOOKUP, and arrays that change size to make your referencing tasks automatic and easy.


Two Tables, One Answer: What the Lookup Problem Is

To make any Excel automation project work, you need to understand your source and destination tables. Here is what they are:

  • Table A: This is your source data. People often call this a "raw dump" or data saved from a system, API, or database.
  • Table B: This is your table for results or a summary. It might be a dashboard, monthly report, or error tracker. And it gets its data from Table A.

Imagine Table A has session logs with many details. These include UserID, session times, status codes, and messages. Table B only needs summary rows for each UserID. It would show the last login, active sessions, and status details.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Typical Excel lookup scenarios include:

  • Getting names for error codes.
  • Getting customer information using IDs from big CRM exports.
  • Checking transactions against vendor or pricing records for certain dates.
  • Bringing together logs or metrics using keyword filters or number limits.

Why Automating Lookups Matters

  • ✅ Cuts down on human mistakes from copying and pasting data.
  • ✅ Keeps reports current and they update themselves.
  • ✅ Saves time for developers and analysts.
  • ✅ Makes Excel work like a front-end for your backend data.

You might use Excel to analyze data or make a first version of a data system. Either way, knowing how to use Excel lookups well makes you better at what you do.


INDEX vs. VLOOKUP: How to Pick the Best Formula

Most Excel users usually start with VLOOKUP. It looks for a match in a column going down and gives you a value from a column on the right. But developers and power users often stop using VLOOKUP() for the INDEX() and MATCH() combination. This combination is more flexible and strong.

🔍 Reviewing VLOOKUP

=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])

Limitations:

  • It only looks from left to right.
  • It stops working if you change the order of columns.
  • It gets slower with lots of data.

✅ INDEX + MATCH: A Better Choice

INDEX() gets a value from a certain row and column within a chosen area:

=INDEX(range, row_num, [column_num])

MATCH() tells you the position of a value in a list, either by row or column:

=MATCH(lookup_value, lookup_array, [match_type])

Use both together for exact lookups:

=INDEX(TableA[Status], MATCH(A2, TableA[UserID], 0))

This formula finds the row number in TableA[UserID] that matches the value in A2. Then it gets the right Status.

💡 Speed Tip:

  • According to Kamat (2020), INDEX-MATCH works about 15–20% faster than VLOOKUP with lots of data. This is even more true if you use good ranges or Excel tables.

Add Error Handling

Avoid the annoying #N/A error by putting it inside IFERROR():

=IFERROR(INDEX(TableA[Status], MATCH(A2, TableA[UserID], 0)), "Not Found")

Handling missing IDs or unmatched data well makes sure your summary table is still easy to read and looks good.


Use Excel Tables and Named Ranges for Handling More Data

When you turn your data into an Excel Table using Ctrl + T, you get automatic features for its structure. These include automatic range growth, simpler formula setup, and structured names that make sense.

Benefits of Excel Tables:

  • Every new row automatically changes lookup ranges.
  • Formulas are easier to read:
    • Instead of A2:A100, you see TableA[UserID].
  • Dropdown filters and formatting are put on automatically.
  • You can rename table names to match what the data does. For example, ErrorLogs or Users.

Example:

=INDEX(Users[Email], MATCH(D2, Users[UserID], 0))

This way greatly cuts down on formula upkeep as your data gets bigger or more complex.


How to Design Advanced Formulas with LET and LAMBDA

Excel formulas often repeat steps. This makes them work less well. But now you have LET() and LAMBDA(). These are the tools you have been waiting for to build better formulas.

📦 LET(): Keep and Reuse Variables

LET() lets you give names to parts of your formula and use them in that same formula.

Example:

=LET(
 user_id, A2,
 index_row, MATCH(user_id, TableA[UserID], 0),
 INDEX(TableA[Status], index_row)
)

🧠 Benefits:

  • Makes multi-part lookups easier to read.
  • Stops you from doing the same calculations twice, and works faster.
  • Helps you find errors and explain formulas.

🧩 LAMBDA(): Your Own Excel Function

LAMBDA() lets developers make their own functions that they can use again. This turns complex steps into simple names you can call.

Steps:

  1. Go to Formulas → Name Manager → New.
  2. Name: GetStatus
  3. Refers To:
=LAMBDA(id, INDEX(TableA[Status], MATCH(id, TableA[UserID], 0)))

Use it just like Excel’s own functions:

=GetStatus(A2)

Benefits for developers:

  • All steps are in one place.
  • You can use it again across different sheets and with different teams.
  • Easier to connect in big files.

Get Data for Many Columns from One Lookup

In most reports, one row often needs a few pieces of related data. For example, if you match a UserID, you might need:

  • Status
  • Last Visit Date
  • Error Message

The old way uses separate formulas:

=INDEX(TableA[Status], MATCH(A2, TableA[UserID], 0))
=INDEX(TableA[LoginDate], MATCH(A2, TableA[UserID], 0))
=INDEX(TableA[Message], MATCH(A2, TableA[UserID], 0))

If you use Office 365 or Excel 2021+, the XLOOKUP() function makes this simpler:

=XLOOKUP(A2, TableA[UserID], TableA[Status])

Want more than one result? Put them together in an array formula:

=XLOOKUP(A2, TableA[UserID], TableA[[Status]:[Message]])

✅ Simpler code
✅ Has error handling built-in ([if_not_found] argument)
✅ You can also use approximate matches and wildcards.


How to Use Dynamic Arrays to Filter Results

Arrays that change size let you show many results right where you put the formula. FILTER() is one of the most useful for filling tables automatically.

=FILTER(TableA[Status], TableA[UserID]=A2)

Use Cases:

  • Get all error messages a user logged.
  • List all purchase dates for a customer.
  • Get all items in a category.

What about output for many columns?

=FILTER(TableA[[Date]:[Message]], TableA[UserID]=A2)

This lets one formula fill many columns. This is a big move towards reports that update right away in dashboards.


How to Make Big Datasets Work Faster

Excel can get slow with over 10,000 rows if you are not careful. Here is how to keep things quick:

🧰 Tools & Techniques:

  • Use LET() to do fewer calculations.
  • Turn ranges into Excel Tables.
  • Use less or get rid of volatile functions (OFFSET(), INDIRECT(), NOW(), RAND()).
  • Keep the total number of rows small. Save older data somewhere else if you can.
  • Set calculations to manual when you are designing: Formulas → Calculation Options → Manual.

If you still run into problems, it is a sign to look into Microsoft Power Query or external scripts like Python or SQL.


Do Not Make These Lookup Mistakes

Even experts make mistakes. Watch out for these common errors:

Mistake Impact Solution
Using 123 vs. "123" Data types do not match Change all inputs with VALUE() or TEXT() as needed
Hidden trailing spaces Matches do not work Use TRIM() on your source data
Forgetting $ in references References move when you copy them Use $A$2 or TableName[Column] to keep them fixed
Problems with upper/lower case You get extra results you did not expect Excel does not care about upper or lower case by default, but EXACT() can help
Typing over cells that update automatically Stops calculations from working Lock cells or use separate output areas

Example: How to Automate Developer Logs

Let's imagine your exported logs look like this:

UserID Timestamp Status Message
101 4/1/2024 09:01 OK Session started
101 4/5/2024 15:42 Error Timeout
102 4/3/2024 10:22 OK Session started

Goal: Summary Table with:

  • Total Sessions
  • Last Login Time
  • Number of Errors

Formula Set:

=COUNTIF(TableA[UserID], A2)
=MAXIFS(TableA[Timestamp], TableA[UserID], A2)
=COUNTIFS(TableA[UserID], A2, TableA[Status], "Error")

All the calculations update themselves as new logs are added. This gives you an activity dashboard that is almost always up to date.


Make Your Formulas Easy to Share

Readable code matters — even in Excel.

Best Practices:

  • Use Excel Table structured names.
  • Make named formulas and functions using the Name Manager.
  • Split complex steps into many cells or formulas.
  • Add N("Comment") at the end of formulas for notes inside the formula.
  • Check formulas with Formula → Evaluate Formula.

As Burnett & Fisher (2019) found, LAMBDA functions with good notes help teams work together better and make users trust them more.


Checklist for Lookups That Always Work

🟢 Use structured tables (Ctrl + T)
🟢 Name your ranges and functions
🟢 Start with INDEX/MATCH, move to XLOOKUP, and use FILTER carefully.
🟢 Always put IFERROR() around sensitive formulas.
🟢 Clean your data before problems happen: TRIM(), CLEAN(), VALUE().
🟢 Make functions so you can use them again with LET() and LAMBDA().
🟢 Write notes about the steps in complex files so teams understand them.


When to Use Something Other Than Excel

Excel can do a lot, but it might not be the best tool for these situations:

  • Datasets with over 100,000 rows that need many merges.
  • Needs for very fast work (for example, updating every second).
  • Automatic connections with SQL databases, APIs, or cloud services.

Then, think about using:

  • Power Query: For joining, filtering, and changing big datasets.
  • Power BI: More advanced ways to model data and make charts.
  • Python + Pandas: Complete tools for data work.
  • SQL scripting: Direct, fast access to related data.

Let Excel do what it does best — making summaries, letting you interact with data, and creating early versions. Let other tools do the hard work when you need to.


Make Excel Work Like an Automatic Machine

When used well, Excel becomes more than a spreadsheet. It is a tool that automates things. Lookups with INDEX/MATCH, tables that change size, LAMBDA functions you can use again, and FILTER() arrays give developers what they need. They can build models that respond fast and are smart right inside Excel.

You might be getting system logs, filtering daily numbers, or changing summary tables that use many lookups. Knowing these tools well means Excel works quietly in the background. It fills tables, checks entries, and turns raw data into useful information.


Citations

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading