# Merge (horizontal)

### Why Merge Datasets

Mito's merge functionality can be used to combine datasets together horizontally. Merge looks for matches between the key column of the first sheet and the key column of the second sheet.&#x20;

{% hint style="info" %}
Looking to combine datasets vertically by stacking rows on top of each other? You're looking to concatenate. Check out concatenate documentation [here.](/how-to/combining-dataframes/concatenate-dataframes.md)
{% endhint %}

{% hint style="info" %}
Looking to include use VLOOKUP like in Excel? Checkout the VLOOKUP formula documentation [here](https://docs.trymito.io/how-to/interacting-with-your-data/mito-spreadsheet-formulas#vlookup).&#x20;
{% endhint %}

### How to Merge Datasets

Open the Merge Taskpane through the `Home` tab by clicking `Merge > Merge (horizontal`. Then, configure the merge taskpane:

1. Select the Merge Type:
   1. **Left Merge**: Includes all rows from the first sheet and only matching rows from the second sheet. Includes all matches.
   2. **Right Merge**: Includes all rows from the second sheet and only matching rows from the first sheet. Includes all matches.
   3. **Inner Merge**: Only includes rows that have matches in both sheets.
   4. **Outer Merge**: Includes all rows from both sheets, regardless of if there is a match in the other sheet.
   5. **Lookup Merge**: Left join, but only includes the first match from the second sheet if there are multiple. Just like a Vlookup in Excel.
   6. **Unique in Left:** Includes each row from the first sheet that doesn't have a match in the second sheet.
   7. **Unique in Right:** Includes each row from second sheet that doesn't have a match in the first sheet.
2. Set the merge keys. These are the keys that must match for the rows to be merged. You can create as many merge keys as you want.
3. Then, optionally choose which columns from each dataset you want to keep in the final merge dataframe.

<figure><img src="/files/jRJRDXphDWe7zjPS1jPb" alt=""><figcaption><p>Opening and configuring a dataframe merge.</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.trymito.io/how-to/combining-dataframes/merging-datasets-together.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
