Skip to content
Data Integration & ETL · 3 min

Combine Tables In Excel: In Minutes (No-Code Solution)

Need to combine two tables in Excel, but struggling to understand how? Read our quick, no-code guide to learn exactly how to do it in just a few minutes.

Two tables side by side: ERP data listing order IDs with start and stop timestamps, and sensor data listing timestamps with two sensor readings, colour-coded to show which rows belong to the same order

Here’s a scenario (that happens to be typical in the manufacturing world) – Dataset A (ERP data) contains a date range, and Dataset B (Sensor Data) contains rows that fall within the date range of dataset A.

Example:

Two source tables side by side: ERP Data listing Order ID, Status and Time with START and STOP rows for orders O111 and O222, and Sensor Data listing Time, Sensor1 and Sensor2 with six timestamped readings, colour-coded to show which readings fall inside which order

The Objective

Our goal is to combine the two datasets with “Time” as the common column. We need to place the Order ID next to the Sensor values so it looks like this:

The same two tables merged into one Combined Data table of ten rows, where each order's START and STOP rows bracket the sensor readings taken between them and the Sensor1 and Sensor2 values sit on their own rows

Why this is not a trivial task

At the surface, this may look like a simple JOIN (in SQL) or VLOOKUP (in Excel) exercise, but it’s not. Because the “Time” columns in both tables describe a range of time values but not exact times. This operation involves a complex, multi-step SQL operation.If you’re trying to do this with code, you need to –

  • Perform an Outer JOIN with the two datasets
  • Then deal with missing or null values. (which you can solve through another non-trivial piece of code.)

A simple, code-free and automated solution using Mammoth

Firstly, for those who don’t know about Mammoth Analytics, it is a lightweight, code-free data management platform.

It provides powerful tools for the entire data journey, including data retrieval, consolidation, storage, cleanup, reshaping, analysis, insights, alerts and more.

Okay, let’s get started

The following steps describe how we can perform this task, easily, and in a couple of minutes.

First, you need to bring your data into Mammoth. We offer a lot of easy ways to do that.

For our example, I just uploaded the two CSV files from my computer into Mammoth.

Mammoth's Data Library listing two uploaded files, Erp at 3 columns by 4 rows and Sensor at 3 columns by 6 rows

Now, our goal is to combine two separate datasets into one and then perform some transformations on the Combined Data.

A diagram of two boxes, ERP Data and Sensor Data, with arrows converging into a single Combined Data box

Step 1: Send the ERP data into another Dataset called “Combined Data”

To do this, open up any of the datasets, go to “Data Preparation” and use the “Merge  & Branch out > Branch out to dataset” option.

Mammoth's function menu open on the ERP dataset with Merge and Branch Out expanded to show Lookup, Join and Branch Out To Dataset, and an arrow pointing at Branch Out To Dataset

Now send this data to a new Dataset called “Combined Data”

Mammoth's Branch Out To Dataset panel with Create a new Dataset selected and Combined data typed into the new dataset name field

If you’ve selected “Keep this task in the data pipeline”, you’ll now see a step in the pipeline indicating your action.

The same Branch Out To Dataset panel on the Sensor dataset, this time with Add to an existing Dataset selected, Combined data as the target, and Time mapped to Time while Sensor1 and Sensor2 each create a new column

Step 2: Send the Sensor data into the same “Combined Data” Dataset

Open up the Sensor Dataset and perform similar steps as Step 1, only this time it needs to be sent to the existing “Combined Data” dataset.

The same Branch Out To Dataset panel on the Sensor dataset, this time with Add to an existing Dataset selected, Combined data as the target, and Time mapped to Time while Sensor1 and Sensor2 each create a new column

In your Data Library, you’ll see a new dataset called “Combined Data”.

Mammoth's Data Library showing the new Combined Data dataset at 5 columns by 10 rows built from two batches, with ERP.csv and Sensor.csv listed beneath it

When you open that file, you will see the following:

The Combined Data dataset open at ten rows, where the four ERP rows carry Order ID and Status and the six sensor rows carry only Time, Sensor1 and Sensor2

Step 3: Fill the missing or null values in the “Combined Data” Dataset

First, let’s sort the data in ascending order by Time.

The Time column menu open on the Combined Data view, with the sort dropdown showing Ascending and Descending above options for date format, filtering and column changes

Which gives you this:

The Combined Data view sorted by time, so each order's sensor readings now sit between its START and STOP rows, leaving Order ID and Status blank on the reading rows

Now, to fill the missing Order ID values, we just need to use the Fill Missing Values function.

Mammoth's function menu with Column Functions expanded, highlighting Fill Missing Values alongside New Column, Combine Multiple Columns, Split Into Multiple Columns and Convert Column Type

Select the Order ID column in “fill empty cells in“ drop-down and to fill the values from the cells above the empty cell, select “above“ in “with values from“ drop-down. Its worth noticing that the grouping is not applicable here, so we will fill the missing values without adding a grouping rule.

Mammoth's Fill Missing Values panel set to fill empty cells in Order ID with the value above, ordered by Time ascending, with a worked example showing gaps filled downward

Which gives you this final result:

The finished Combined Data view with Order ID carried down onto every sensor row, and a task pipeline on the left recording the single Fill Missing Values step

And we’re done

We’ve achieved a code-free solution to combining two time-series datasets in a couple of minutes.

An extra bonus. automation is built-in. New data coming into any of the original datasets automatically sends it to the “Combined Data” Dataset

Once you’re done with this task, you can explore other ways of getting your data in the right shape using the Mammoth platform.

Try it on your data. Today.

The argument in this post is easier to check than to read about. Start free and see.

  • 21-day Pro trial
  • No credit card
  • Viewers always free