Creating a data model in excel is very similar to creating relationships between tables in access.

The data model in Excel is a type of data table where two or more two tables are in a relationship with each other through a common or more data series. In the data model, tables and data from various other sheets or sources come together to form a unique table that can access the data from all the tables.

For example, a data table containing tables of customers, product items, and product sellers. We can use the Excel data model to connect this dataset and create a relationship between them.

  • It allows integrating data from multiple tables by creating relationships based on a common column.
  • Data models are used transparently, providing tabular data that can be used in a Pivot Table in ExcelA Pivot Table is an Excel tool that allows you to extract data in a preferred format (dashboard/reports) from large data sets contained within a worksheet. It can summarize, sort, group, and reorganize data, as well as execute other complex calculations on it.read more and Pivot Charts in excelIn Excel, a pivot chart is a built-in feature that allows you to summarize selected rows and columns of data in a spreadsheet. It is a visual representation of a pivot table that helps in the summarization and analysis of datasets, patterns, and trends.read more. In addition, it integrates the tables, enabling extensive analysis using pivot tables, power pivot, and Power View in ExcelExcel Power View is a data visualization technology that helps you create interactive visuals like graphs, charts. It allows you to analyze data by looking at the visuals you created. As a result, it makes your excel data more meaningful and insightful for better decision making.read more.
  • The data model allows loading data into Excel’s memory.
  • It is saved in memory, where we cannot directly see it. Then We can instruct Excel to relate data to each other using a common column. The ‘Model’ part of the data model refers to how all tables relate.
  • The data model can access all the information it needs, even in multiple tables. After the data model is created, Excel has the data available in its memory. With the data in its memory, we can access the data in many ways.
Creating a data model in excel is very similar to creating relationships between tables in access.

You are free to use this image on your website, templates, etc, Please provide us with an attribution link

Article Link to be HyperlinkedFor eg:

Source: Data Model in Excel (wallstreetmojo.com)

Examples

Example #1

We have three datasets related to the salesperson: the first contains revenue information, the second includes the salesperson’s income and the third consists of the expenses of the salesperson.

Creating a data model in excel is very similar to creating relationships between tables in access.

To connect these three datasets and make a relationship with them, we make a data model with the following steps:

  • Convert the datasets to table objects:

We cannot create a relationship with ordinary datasets. The data model works with only Excel TablesIn excel, tables are a range with data in rows and columns, and they expand when new data is inserted in the range in any new row or column in the table. To use a table, click on the table and select the data range.read more objects. To do this:

  • Step 1 – We must first click anywhere inside the dataset, click on the “Insert” tab, and click on “Table” in the “Tables” group.
Creating a data model in excel is very similar to creating relationships between tables in access.
  • Step 2 – Check or uncheck the ‘My table has headers’ option and click “OK.”
Creating a data model in excel is very similar to creating relationships between tables in access.
  • Step 3 – We must enter the table’s name in the “Table Name” in the “Tools” group with the new table selected.
Creating a data model in excel is very similar to creating relationships between tables in access.
  • Step 4 – Now, we can see that the first dataset is converted to a “Table” object. On repeating these steps for the other two datasets, we know that they also get converted to “Table” objects as below:
Creating a data model in excel is very similar to creating relationships between tables in access.

Adding the “Table” objects to the Data Model: Via Connections or Relationships.

Via Connections

  • We must select one table, click on the “Data” tab, and click on “Connections.”
Creating a data model in excel is very similar to creating relationships between tables in access.
  • There is an icon for “Add.” Expand the dropdown of “Add” and click on “Add to the Data Model” in the resulting dialog box.
Creating a data model in excel is very similar to creating relationships between tables in access.
  • Click on “Tables” in the resulting dialog box, select one of the tables, and click “Open.”
Creating a data model in excel is very similar to creating relationships between tables in access.

In doing this, it would create a workbook data model with one table, and a dialog box would appear as follows:

Creating a data model in excel is very similar to creating relationships between tables in access.

So if we repeat these steps for the other two tables, the data model will contain all three tables.

Creating a data model in excel is very similar to creating relationships between tables in access.

We can now see that all three tables appear in the “Workbook Connections.”

Via Relationships

Create the relationship: Once both the datasets are table objects, we can create a relationship between them. To do this:

  • First, we should click on the “Data” tab and “Relationships.”
Creating a data model in excel is very similar to creating relationships between tables in access.
  • As a result, we can see an empty dialog box with no current connections.
Creating a data model in excel is very similar to creating relationships between tables in access.
  • Then, click on “New,” and another dialog box appears.
Creating a data model in excel is very similar to creating relationships between tables in access.
Creating a data model in excel is very similar to creating relationships between tables in access.
  • With all these four settings selected, click on “OK.” A dialog box appears as follows on clicking on “OK.”
Creating a data model in excel is very similar to creating relationships between tables in access.

If we repeat these steps to relate the other two tables: the “Revenue” Table with “Expenses” table, then they also get connected in the data model as follows:

Creating a data model in excel is very similar to creating relationships between tables in access.

Excel now creates the relationship behind the scenes by combining data in the data model based on a common column: Salesperson ID (in this case).

Example #2

Now, in the above example, we wish to create a PivotTable that evaluates or analyzes the table objects:

  1. We must first click on “Insert” -> “PivotTable.”


    Creating a data model in excel is very similar to creating relationships between tables in access.

  2. We need to click on the “Use an external data source” option in the resulting dialog box and click on “Choose Connection.”


    Creating a data model in excel is very similar to creating relationships between tables in access.

  3. Then, we must click on “Tables” in the resulting dialog box, select the “Workbook Data Model” containing three tables, and click “Open.”


    Creating a data model in excel is very similar to creating relationships between tables in access.

  4. Select the “New Worksheet” option in the location and click on “OK.”


    Creating a data model in excel is very similar to creating relationships between tables in access.

  5. Consequently, the “PivotTable Fields” pane will display table objects.


    Creating a data model in excel is very similar to creating relationships between tables in access.

    Creating a data model in excel is very similar to creating relationships between tables in access.


    Now we can make changes in the PivotTable accordingly to analyze the table objects as required.

  • For instance, in this case, if we wish to find the total revenue or revenue for a particular salesperson, then a PivotTable is created as follows:


    Creating a data model in excel is very similar to creating relationships between tables in access.

    Creating a data model in excel is very similar to creating relationships between tables in access.


    It is an immense help in the case of a model/table containing a large number of observations.
  • So, we can see that the pivot table instantly uses the data model (picking it by choosing connection) in Excel memory to show relationships between tables.

    Things to Remember

    • We can analyze data from several tables at once using the data model.
    • By creating relationships with the data model, we surpass the need for using VLOOKUPThe VLOOKUP excel function searches for a particular value and returns a corresponding match based on a unique identifier. A unique identifier is uniquely associated with all the records of the database. For instance, employee ID, student roll number, customer contact number, seller email address, etc., are unique identifiers. read more, SUMIF, INDEX functionThe INDEX function in Excel helps extract the value of a cell, which is within a specified array (range) and, at the intersection of the stated row and column numbers.read more, and MATCH formulas as we do not need to get all columns within a single table.
    • Models are implicitly created when datasets are imported in Excel from outside sources.
    • We can create table relationships automatically if we import related tables with primary and foreign key relationships.
    • While creating relationships, the columns that we are connecting in tables should have the same data type.
    • With the pivot tables created with the data model, we can add slicers and slice them on any field at pivot tables we want.
    • The advantage of the Data Model over LOOKUP() functionsThe LOOKUP excel function searches a value in a range (single row or single column) and returns a corresponding match from the same position of another range (single row or single column). The corresponding match is a piece of information associated with the value being searched. read more is that it requires substantially less memory.
    • Excel 2013 supports only one-to-one or one to many relationships, i.e., one of the tables must have no duplicate values on the column we are linking to.

    This article is a guide to Data Model in Excel. We discuss creating a data model from Excel tables using connections and relationships, practical examples, and a downloadable Excel template. You may learn more about Excel from the following articles: –