Exchange (Copy, Import, Export) Data Between Excel and Access

Similar documents
Read More: How to Make Excel Graphs Look Professional & Cool [10 Awesome Tips]!

So let s get started with a simple example to illustrate the difference between the worksheet level protection and workbook level protection.

Changing Case using Worksheet Functions and Excel VBA

Read More: Index Function Excel [Examples, Make Dynamic Range, INDEX MATCH]

How to Create a For Next Loop in Excel VBA!

Pivot Table Project. Objectives. By the end of this lesson, you will be able to:

Read More: How to Create Combination Charts with a Secondary Axis in Excel

How to Use the Select Case Structure in Excel VBA

How to Use Do While Loop in Excel VBA

Getting Started Guide. Sage MAS Intelligence 500

Sage 50 U.S. Edition Intelligence Reporting Getting Started Guide

Excel Shortcuts Increasing YOUR Productivity

Microsoft Excel. for Finance Majors. Microsoft Excel for Finance Majors

Getting Started Guide

Do Until Loop in Excel VBA with Examples

MAX vs MAXA vs LARGE and MIN vs MINA vs SMALL Functions in Excel

TABLE OF CONTENTS PAGE

Sage 500 ERP Business Intelligence

Read More: How to Make a Pie Chart in Excel [Video Tutorial]

TABLE OF CONTENTS. Getting Started Guide

TABLE OF CONTENTS PAGE

Excel Tables and Pivot Tables

Rev. C 11/09/2010 Downers Grove Public Library Page 1 of 41

Microsoft Excel 2010 Training. Excel 2010 Basics

2. create the workbook file

Microsoft Access 2010

My Top 5 Formulas OutofhoursAdmin

University of North Dakota PeopleSoft Finance Tip Sheets. Utilizing the Query Download Feature

Microsoft Excel 2016 LEVEL 3

Microsoft Access 2013

SPREADSHEET (Excel 2007)

How to Excel - Part 2

Advanced Excel Charts : Tables : Pivots

Looking good! Slicing and dicing to visualize data in Excel Dashboards Michael Winecoff UNC Charlotte J. Murrey Atkins Library

Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts. Microsoft Excel 2013 Enhanced

Pivot Tables, Lookup Tables and Scenarios

Patricia Andrada Quick Guide Excel 2010 Data Management-July 2011 Page 1

Read More: Keyboard Shortcuts for Moving around Excel Spreadsheets

Excel Tables & PivotTables

Market Insight Excelsior 2 Module Training Manual v2.0

Lab 7 Macros, Modules, Data Access Pages and Internet Summary Macros: How to Create and Run Modules vs. Macros 1. Jumping to Internet

Excel 2007 New Features Table of Contents

Pivot Tables in Excel Contents. Updated 5/19/2016

Formulas, LookUp Tables and PivotTables Prepared for Aero Controlex

MS Excel Advanced Level

Office 2016 Excel Basics 21 Video/Class Project #33 Excel Basics 21: Relationships Rather than VLOOKUP for PivotTable Reports (Excel 2016 Data Model)

Contents. Group 2 Excel Handouts 2010

Switching to Sheets from Microsoft Excel Learning Center gsuite.google.com/learning-center

Intermediate Microsoft Excel 2010

1. Right-click the worksheet tab you want to rename. The worksheet menu appears. 2. Select Rename.

Create a PivotTable. If you prefer to design the PivotTable yourself, you can create a manual PivotTable.

Creating Automated Dashboard Excel 2013 Contents

Chapter at a glance. Analyze. Filter. Format. Create. Analyze data dynamically by using PivotTables, page 288

Microsoft Access 2010

Chapter 7 Notes Chapter 7 Level 1

Excel 101. DJ Wetzel Director of Financial Aid Greenville Technical College

Identifying Updated Metadata and Images from a Content Provider

Access Intermediate

FORMATTING EXCEL TIMECARDS FOR IMPORT INTO FOUNDATION

COPYRIGHTED MATERIAL. Making Excel More Efficient

Create a Relationship to build a Pivot Table

3/31/2016. Spreadsheets. Spreadsheets. Spreadsheets and Data Management. Unit 3. Can be used to automatically

How to Create Excel Dashboard used in Solutions Conference By Matt Mason

Getting Started With Excel

Microsoft Excel 2013/2016 Pivot Tables

M i c r o s o f t E x c e l A d v a n c e d P a r t 3-4. Microsoft Excel Advanced 3-4

SAS (Statistical Analysis Software/System)

SAS (Statistical Analysis Software/System)

Installation and Getting Started Guide Alchemex for MYOB Account Right

Using Microsoft Excel

Using Microsoft Excel to View the UCMDB Class Model

Simply Accounting Intelligence Tips and Tricks Booklet Vol. 2

Tips & Tricks: MS Excel

Access Intermediate

MIS0855: Data Science In-Class Exercise for Mar Creating Interactive Dashboards

WAAT-PivotTables Accounting Seminar

Candy is Dandy Project (Project #12)

Intermediate Excel Training Course Content

MICROSOFT Excel 2010 Advanced Self-Study

MODULE III: NAVIGATING AND FORMULAS

Quick Guide for Excel 2015 Data Management November 2015 Training:

Introduction to Microsoft Access 2016

New Perspectives on Microsoft Excel Module 5: Working with Excel Tables, PivotTables, and PivotCharts

Creating and Using an Excel Table

Microsoft How to Series

Tutorial: Create an Excel Dashboard. Overview. **** Download the Example Dashboard ****

Chapter 4. Microsoft Excel

Excel Intermediate. Click in the name column of our Range of Data. (Do not highlight the column) Click on the Data Tab in the Ribbon

SAP BusinessObjects Live Office User Guide SAP BusinessObjects Business Intelligence platform 4.1 Support Package 2

Introduction to Microsoft Excel 2016

INTRODUCTION ACCESS 2010

Tutorial 2/4: Calculations & Functions. Tutorial 1/4: Getting Started. Tutorial 3/4: Statistical Analysis. Tutorial 4/4: Basic Formatting

Beginner s Guide to Microsoft Excel 2002

Contents Part I: Background Information About This Handbook... 2 Excel Terminology Part II: Advanced Excel Tasks...

PHLI Instruction (734) Introduction. Lists.

DecisionPoint For Excel

USING MICROSOFT EXCEL 2016 Guided Project 4-3

Excel Level 3 - Advanced

MS Office 2016 Excel Pivot Tables - notes

Building Self-Service BI Solutions with Power Query. Written By: Devin

Transcription:

Excel usage is widespread and Excel is often the go-to Office application for data entry, analysis, and manipulation. Microsoft Access provides relational database capability in a compact desktop environment. Fewer people use Access, even though it has many features for handling data and the interface is user-friendly. Access has all the functionality of a relational database application including the ability to create tables, specify and restrict data types for each table, create simple and advanced queries, SQL manipulation and form creation for user input. Excel, in addition to being the more familiar interface, has advanced charting capabilities and extended Pivot Table functionality and options. Integration of Excel and Access, allows one to take advantage of the ease of data entry and advanced charting capabilities of Excel, combined with the relational database interface and environment of Access. Here are a few handy tips for exchanging data between the two Office Applications: Table of Contents 1 1) Understanding the logic involved in Access table structure and creation 2 2) Removal of duplicates in Excel, for ease of subsequent table design or integration of the source data into Access 3 3) Using the TRIM Function() to remove unnecessary spaces and using the underscore to maintain consistency between field names in Access and column headings in Excel 4 4) Importing data into Access from Excel dealing with the two main scenarios 5 5) Using Table Analyzer to normalize imported data and split the data into separate tables in Access 6 6) Importing data from Access into Excel and using VLOOKUP to link the data and populate columns 7 7) Using data already set up in a relational Access database, for Power Pivot manipulation 8 Download Files 9 Conclusion 10 Some useful links 1) Understanding the logic involved in Access table structure and creation Access is a relational database as mentioned. This means the tables in the Access database are all related to one another. Each record in an Access database should be able to be uniquely identified. This is achieved through the use of a primary key. This primary key usually consists of one field, however, in some cases, it can be a combination of more than one field. This primary key is mandatory and Access automatically adds an ID column, which serves as the primary key for the table. In Excel a primary key is not a mandatory requirement when creating tables, so users often leave it out. All rights reserved to ExcelDemy.com. 1

This situation is shown below, the first image shows the Access table in both Datasheet and Design View and the primary key that is automatically added. The second image shows the Excel table and the way, the data would most likely be entered in Excel. All rights reserved to ExcelDemy.com. 2

The data entry in the Excel table is not incorrect. However, if you are planning to use Excel as the data entry software and then import the tables into Access later on (this is analogous to using Excel as a user-friendly form for Access in a way), then it s best, from the onset to add a primary key to the Excel table, when setting up the spreadsheet in Excel. This is to ensure that users get familiarized and orientated with the primary key concept and to eliminate data redundancy and duplication early on, as much as is possible. This is simple enough to do in Excel when creating tables in Excel. If you have a relatively small table, that does not already contain a primary key column, and there is no duplication or redundancy in the Excel table you can easily add this column. Simply, right-click a cell in your first column in the table, choose Insert, Table Columns to the Left. Then rename this column and call it ID. To populate this column, select the first cell of the column and type in 1, then go to the second cell of the column and type in 2, and then highlight the above two All rights reserved to ExcelDemy.com. 3

cells and drag down using Autofill to populate the rest of the column. Also, a handy tip to remember is that the field names in Access tables are equivalent to the column headings in Excel tables. You can also copy the data in the table from Access and paste in a new sheet in Excel. This is advisable for an Access table with a small amount of data. Select all the rows in Access that you want to copy, go to Home tab, in the Clipboard group, choose Copy or press CTRLC on your keyboard. Then on a new sheet in the Excel Workbook, press CTRL-V on your keyboard to paste the Access table in the Excel sheet. The Access table is pasted as a range with headings and can be converted to an Excel table, by selecting a cell in the range and pressing CTRL-T on your keyboard. Make sure the checkbox, my table has headers is ticked and then press Ok, in order to convert the range to an Excel table. All rights reserved to ExcelDemy.com. 4

Leading on from the above-mentioned points. In Access, the information is divided into major entities or subjects. For example, an Access database designed for a small store would more than likely contain separate tables called Products, Orders, Customers and Employees (with the relationships designated). In Excel, it is not unusual to see the All rights reserved to ExcelDemy.com. 5

information, which would be stored in separate tables in Access, combined in one Excel table, as shown below. Now as mentioned, the way the data is entered into the Excel table is not incorrect. However, if Excel and Access are going to be integrated, in terms of Excel is the data entry software and Access provides the querying and database functionality. It is best to divide the information in Excel that s stored in one big table into four smaller tables, and place each table on its own sheet as shown below. Also, it s advisable to match the names of the fields in the table in Access, to the headings of the columns in the table in Excel, in order to avoid confusion and maintain consistency. All rights reserved to ExcelDemy.com. 6

2) Removal of duplicates in Excel, for ease of subsequent table design or integration of the source data into Access It is often difficult to see unique values, at a glance, in Excel tables that contain many rows of data. Let s say one wanted to see the number of unique products for an Excel table, that All rights reserved to ExcelDemy.com. 7

contained 100 rows of data, in order to design an efficient table in Access using the information gleaned from the Excel workbook. The Excel workbook in this example is based on some data from a hypothetical online retailer. The Excel table contains the date the product was sold, the name of the product, and the quantity sold as shown below. Firstly, make a copy of the spreadsheet containing the table in the workbook, in order to keep the original data intact and then work on the copy. With a cell in the Excel table selected, in order to activate the context-sensitive Table Tools options, select the Design tab, and in the Tools group, choose the Remove Duplicates option as shown below. All rights reserved to ExcelDemy.com. 8

The Remove Duplicates dialog box should come up and uncheck Date_Of_Sale and Quantity and click Ok. A message box should pop up stating how many duplicate values were removed. Click Ok. All rights reserved to ExcelDemy.com. 9

All rights reserved to ExcelDemy.com. 10

The resultant table in Excel can be used to help glean information for the Access table for the online retailer s proposed Access database. All rights reserved to ExcelDemy.com. 11

All rights reserved to ExcelDemy.com. 12

3) Using the TRIM Function() to remove unnecessary spaces and using the underscore to maintain consistency between field names in Access and column headings in Excel Access field names cannot begin with leading spaces, so one can use the TRIM function() on the names of the column headings of tables in Excel, in order to remove spaces. Also, let s say eventually one needs to import data to SQL Server or another database such as Oracle. So, the flow of the integrated solution will be data entry in Excel, then exporting this data to Access, and then importing the Access tables into enterprise-level databases such as SQL Server or Oracle. Other databases do not read spaces between names of fields very well. So instead of calling the name of the heading column in the Excel table, Name of Product call it Name_of_Product, using underscores for ease of integration into other databases further down the line. SQL also handles this naming style of tables much better, than names with spaces. One can use the caption property in Access, so if your field name in your table is Name_of_Product, enter the caption or label as Name of Product in design view. So in datasheet view or on forms Name of Product is used instead, while the underlying field name has the underscores. This is mainly for aesthetic purposes for front-end viewers of the database in Access. All rights reserved to ExcelDemy.com. 13

All rights reserved to ExcelDemy.com. 14

4) Importing data into Access from Excel dealing with the two main scenarios In scenario one, one has a totally blank Access database, and one wants to import the data from Excel (the tables in Excel are setup with IDs and redundancy and duplication are reduced as much as is possible) and use Excel as the data entry programme or form. With the Access database open, go to the External Data tab, in the Import & Link group, choose Excel as shown. The Get External Data Excel Spreadsheet Wizard should pop up. Navigate to the Excel Workbook that contains the data. Choose the Link to the data source by creating a linked table option. This allows data entry in Excel since we want users to enter the data in Excel. Any changes made to this data in Excel is reflected in Access, but nothing can be edited in Access. Its almost ready-only in Access, in terms of data entry in datasheet view. Click Ok. All rights reserved to ExcelDemy.com. 15

If the table is set up correctly in Excel, Access will automatically detect and check that the First Row Contains Column Headings as shown below. All rights reserved to ExcelDemy.com. 16

Clicking Next leads one to the final step in the process, which asks one to enter a linked table name and then click Finish. All rights reserved to ExcelDemy.com. 17

A message should pop up to say the table has been linked. All rights reserved to ExcelDemy.com. 18

All rights reserved to ExcelDemy.com. 19

All rights reserved to ExcelDemy.com. 20

This exposes the Excel data to the additional SQL functionality, and expression builders for complex query creation, available in the Access environment. The results of the complex queries could later be used in Excel dashboards. It is advisable, but not mandatory to keep the Excel data entry tables and the Access database with the linked tables in the same folder or directory just for organizational purposes. In scenario two, one has a blank or populated Access database and one wants to import All rights reserved to ExcelDemy.com. 21

Excel tables, but not have them linked. One wants to edit them in Access. In that way whatever changes are made later on in the Excel sheet are not reflected in Access and one then has the data entirely in Access for editing and querying. This is usually the option chosen when one needs to strictly maintain control, of the types of data entered in the tables. Again, with your Access database open, go to the External Data tab, in the Import & Link group, choose Excel as shown. In this case, when the wizard pops up, choose to Import the source data into a new table in the current database, in order to create a copy of the table in Access that is now unlinked to the original Excel table. Click Ok. All rights reserved to ExcelDemy.com. 22

Click Next on the next screen. All rights reserved to ExcelDemy.com. 23

One then gets to specify the information about the fields one is importing, as shown below. The wizard also allows one to choose which fields to skip as well. Since often Excel tables may contain data that actually needs to be in other tables in Access, one can then avoid importing these columns into the current table. All rights reserved to ExcelDemy.com. 24

One can then let Access add a primary key, or choose one s own primary key. In this case, since the table already had a designated ID column in Excel, the second option was chosen as shown. All rights reserved to ExcelDemy.com. 25

Click Next. Then choose a name for the table in Access and click Finish. All rights reserved to ExcelDemy.com. 26

You ll be asked whether you want to save the import steps, for now just click close. The table is now in Access for further editing, entry, and manipulation and is unlinked to the Excel workbook. All rights reserved to ExcelDemy.com. 27

5) Using Table Analyzer to normalize imported data and split the data into separate tables in Access Later versions of Access, have the Table Analyzer tool, which helps users separate one table into many tables. This is especially useful if one did import the data from a big Excel table and one is struggling to separate the tables. One can launch this wizard as part of the import process and check the box, I would like a wizard to analyze my table after importing the data as shown below. All rights reserved to ExcelDemy.com. 28

Or one can access it, if the tables are already imported as standalone Access tables, by going to Database Tools, in the Analyze group, choose Analyze Table. The Table Analyzer wizard should be launched, which will guide you through the steps of creating separate tables. All rights reserved to ExcelDemy.com. 29

Table Analyzer, however, does not always guess right, so use it with caution. 6) Importing data from Access into Excel and using VLOOKUP to link the data and populate columns One can import Access tables into Excel worksheets. With an Excel workbook opened, go to the Data tab, in the Get External Data group, choose From Access as shown below. Navigate to the Access database containing the tables, you want to import into your Excel All rights reserved to ExcelDemy.com. 30

spreadsheet. Select the table one wants to import, in this case, the ProductT. All rights reserved to ExcelDemy.com. 31

Click Ok. Choose to Import the data as a Table, on the existing worksheet, choose cell A1, and then Click Ok. All rights reserved to ExcelDemy.com. 32

The table is imported as an Excel table. The same was done for the three other tables in the database, namely Orders, Employees, and Customers tables. One now has an Orders table which looks like the one below. This table with numbers in Customer_ID, Product_ID and Employee_ID can be counterintuitive and confusing for Excel users not used to the relational database theory and tables. Thus one could add three helper columns to the table called Actual_Customer, Actual_Product and Actual_Employee as shown below. In Cell F2, the following formula was used: All rights reserved to ExcelDemy.com. 33

=VLOOKUP([@[Customer_ID]],Table_TablesToBeImportedIntoExcel.accdb5,2,FALS E) Where, [@[Customer_ID]] refers to cell C2, which contains the lookup value, Table_TablesToBeImportedIntoExcel.accdb5 refers to the imported Customers table on the Customers sheet, (Excel gives this table a default name), highlight the data, but not the column headings, the same way one would for a normal VLOOKUP, the customer name is in column 2, and the type of lookup is an exact match. Double click and send the formula down to populate the Actual_Customer column. Do the same thing to populate the Actual_Product and Actual_Employee columns. So one can quickly repopulate Excel tables with actual text values as needed, using the VLOOKUP functionality in order to orientate the Excel users. 7) Using data already set up in a relational Access database, for Power Pivot manipulation Power Pivot is a Business Intelligence tool available with Excel 2013 and later versions of Excel. It also requires data to be input in a relational manner. So, what you can do when you are importing Access tables into Excel (already normalized and designed using relational data logic), is to add the imported tables to the data model. In a blank workbook, go to Data, get External data and choose from Access as for the case above. However, this time when asked to select a table, check the Enable selection of multiple tables option in the Select Table dialog box and select all the tables as shown below: All rights reserved to ExcelDemy.com. 34

Click Ok. Make sure the PivotTable Report option is selected, the Add this data to the Data Model should be checked because we imported multiple tables. If you only import one table at a time, you will need to check this option yourself. If you click on the drop-down arrow next to Properties, you should see that the relationships between the tables will also be imported. Click Ok to create the Pivot TableReport, with the tables already added to the Data Model. The relationships should be visible in the PowerPivot for Excel Window, Diagram view. Thus the data is ready for further manipulation using Power Pivot functionality. All rights reserved to ExcelDemy.com. 35

All rights reserved to ExcelDemy.com. 36

Download Files Exchange-Data-Between-Access-and-Excel Conclusion Excel and Access integration allows one to take advantage of the combination of features in Excel and Access. The key to integrating Excel and Access successfully is understanding a little bit about relational database design basics. Understanding a little bit of relational design and table structure will also set you in good stead with respect to taking advantage of Power Pivot and related Business Intelligence tools in the Excel environment. Please feel free to comment and tell us if you integrate Excel and Access, whether or not you use Power Pivot and any other tips for integrating Excel and Access, that you may have. Some useful links Introduction to Access tables Learn about database design basics Normalizing imported data in Access, using Table Analyzer Import Data into Excel and Create a Data Model Start the Power Pivot in Microsoft Excel add in Learn more about Power Pivot Learn about the VLOOKUP Function in Excel Background vector created by Kotkoa Freepik.com 29 SHARES FacebookTwitter Taryn N Taryn is a Microsoft Certified Professional, who has used Office Applications such as Excel and Access extensively, in her interdisciplinary academic career and work experience. She has a background in biochemistry, Geographical Information Systems (GIS) and biofuels. She enjoys showcasing the functionality of Excel in various disciplines. All rights reserved to ExcelDemy.com. 37

She has over ten years of experience using Excel and Access to create advanced integrated solutions. All rights reserved to ExcelDemy.com. 38