Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Importing and exporting data in Excel

From: Excel 2010 Essential Training

Video: Importing and exporting data in Excel

Although you can copy and paste data in and out of Excel like you can in almost every other program, Excel lets you take this a step further using its Import and Export features. These features are useful when you have to share data with programs that don't work directly with Excel. Maybe they don't recognize Excel's file format. So let's say we get info from a database and we need to bring that data into this worksheet. We are going to start by importing here into Cell A5. But before we do that I want you to see what the raw data will look like.

Importing and exporting data in Excel

Although you can copy and paste data in and out of Excel like you can in almost every other program, Excel lets you take this a step further using its Import and Export features. These features are useful when you have to share data with programs that don't work directly with Excel. Maybe they don't recognize Excel's file format. So let's say we get info from a database and we need to bring that data into this worksheet. We are going to start by importing here into Cell A5. But before we do that I want you to see what the raw data will look like.

I have this file open here in Windows Notepad and you can see the file here as importdata.txt and the first line here, these are our column headers, Last Name, and First Name and so forth and you can look here and you can see we have last names, first names, department and so on. Now we have two of these files in the Chapter 8 folder of the Exercise Files. import data.txt, a text file, and also import data.csv. CSV stands for Comma Separated Values and you can see here these are also separated with commas.

The reason we have two of them is sometimes you'll get data with a TXT extension, sometimes you will get data with a CSV extension, and Excel can treat them slightly differently when you're importing and you'll see that. So I am just going to close this here. So here we are back in Excel and let's go to the Data tab and over here in the left side of the Data tab under the Get External Data group choose From Text. So here in the Chapter 8 folder the Exercise Files, we can see both the CSV and the TXT.

Let's double-click the TXT file and this immediately brings you into the Import Wizard and you can see there are three steps to the Wizard. Now to begin with, you have two choices. Is it Delimited or Fixed Width? Well, we are just talking about Delimited because there are commas separating the values. Fixed Width would use if your original source data was broken up into columns that are the exact same width and separated the exact same amount. That's kind of weird and that's not what this is anyway, so make sure Delimited is selected and click Next. Now this asks us here well, what is the Delimiter? Well as we are talking about, it's commas.

So we want to deselect anything else. Tab is selected here by default, so I am going to deselect that and select commas and as soon as I select Comma, you notice that this is all now separated. So click Next and this allows us to treat the column specially, if we want. So for example if there is a column that maybe we don't want import, we can choose not import it, or if it's a date, we can treat it specially as a date and reformat it as we go. We don't need to do any of that. So click Finish and again this confirms where do we want to start importing the data.

So click OK and boom, it just puts it in. Now notice something here. The first row repeats what we already had in the worksheet, which means you could delete it. But it's a good thing that it's in here because this way we can measure that oh yes, the last name is indeed the last name, the hours is indeed hours, location is location. So we can just remove this Row 5. Put your mouse pointer on the header for Row 5, so you have that backward pointing arrow, right-click and choose Delete.

Now it's gone. Now we have a nice Excel sheet. So let's go save this under a new name. You could either press the F12 key on your keyboard to Save As or go to the File tab and Save As and let's call this payroll with the imported data and Save. Well, I want to show you a second method of bringing in data. So let's just close this. You could press Ctrl+F4 to close or click the Close button over here and we are going to open the text file. So you can press Ctrl+O to open or click the File tab and choose Open.

This is showing us Excel files. It's not shown us those text file. So we want to click this dropdown list over here and we want to choose Text Files and this shows us both the CSV and the TXT. Double-click the TXT and this launches us back into the Wizard. So again make sure it's Delimited. click Next. If any other Delimiters are selected, you want to deselect and make sure a comma is the only one selected. Click Next, click Finish and there it is and it opens right up and we have our column headers and then we can format it.

We can just close it without saving again. Press Ctrl+F4 to close or click here at the Close button here. Now let's open the CSV. Here is where CSV and the TXT are a little different. Again I will just press Ctrl+O to open. Here's the CSV. Remember, we're looking at Text Files not Excel files. Double-click CSV. And boom, it just opens. No wizard, no nothing. It just brings it right up onto the screen. Okay, that's all for importing. Let's talk a little bit about exporting. Exporting a worksheet takes even fewer steps. we don't have to go through a wizard.

Let's open up the file in Chapter 8 of the Exercise Files. You will probably need to click this drop-down over here and choose All Excel Files. Let's open up the file called Export this. So here we have a pretty typical Excel sheet but we have to modify this here la ittle bit because when we export to CSV, we need to make sure we're only exporting alphanumeric values. Numbers are okay, text is okay, any formatting will be wiped out because text files including CSV files don't support formatting. But we have these graphics here.

We have this Sales thing here that's formatted that's above our column headers. That's no good. We also have here some functions. We have these calculations and we can't export that either. So we need to remove them. The problem is this is a worksheet we really might need to use. So there is kind of a danger if you start deleting parts of this worksheet. It's very easy to save over it and then you have lost some of your data. So my advice is whatever you're doing a process like this, save it under a temporary file name so that way you don't have to worry about messing it up.

So you could either press F12 to Save As or go to the File menu and Save As. And I always save these kind of temporary files as delete. That is I literally call them delete, so that I know I could go back later and delete them without any worries. Save. So let's click this graphic and Delete, click on the edge of this graphic and Delete. And let's delete the first three rows. Put your mouse pointer on the header of where I want, drag down so you have the headers of Rows 1, 2, 3 selected, and right-click the mouse and choose Delete and the same for the Total row.

Right-click the header here of the Total row and press Delete. One more thing we have to do is these numbers here have column headers but we don't have a column header here for our description. We really should put that in. So you could simply click up there and type products. And don't worry that it doesn't have the same formatting as the other columns, because the formatting is going to go away anyway. So now we are going to go and export this and if you want to save over it, press Ctrl+S or press or click the Save button. That's okay.

So here is how we can go and make this a CSV file. Go to the File tab, go do down here to Save & Send, click over here, Change File Type and now you can go over here and choose CSV and Save As. Now that's a lot of work. Let me show you an easier way to do that. I am just going to escape out, so we are back here at the Data tab. All you have to do is a regular old Save As. So you could go to the File tab and Save As or press the F12 key to Save As and then just click over here where it says File Type and now we can choose Comma Separated Values. I think it's a lot easier way to do it and let's just call this product data and click Save.

Now this is giving us a warning that there are parts of this file that are not compatible with CSV because we have all that formatting. That's perfectly fine. Click Yes and there we are now. We can see this product data.csv. So these are features that you might want to use whenever you need to share data between Excel and another program that normally don't talk to each other.

Show transcript

This video is part of

Image for Excel 2010 Essential Training
Excel 2010 Essential Training

80 video lessons · 129832 viewers

Bob Flisser
Author

 
Expand all | Collapse all
  1. 1m 35s
    1. Welcome
      57s
    2. Using the exercise files
      38s
  2. 19m 31s
    1. Exploring three common uses for Excel
      3m 17s
    2. Touring the interface
      3m 38s
    3. Finding the commands you need
      3m 51s
    4. Using Backstage view or the File tab
      3m 25s
    5. Maintaining file compatibility
      5m 20s
  3. 21m 23s
    1. Creating a worksheet
      5m 23s
    2. Techniques for copying and pasting
      3m 57s
    3. Entering data automatically with Auto Fill
      4m 37s
    4. Targeting large data groups
      4m 26s
    5. Changing a worksheet's structure
      3m 0s
  4. 47m 50s
    1. Understanding formulas and functions
      4m 41s
    2. Entering data in a worksheet
      3m 22s
    3. Adding numbers manually
      5m 1s
    4. Adding numbers using Sum and AutoSum
      6m 11s
    5. Adding a whole worksheet
      1m 48s
    6. Working with numbers in columns
      4m 53s
    7. Preventing errors using absolute references
      5m 57s
    8. Working with times and dates
      3m 8s
    9. Using IF
      4m 49s
    10. Using SUMIF and AVERAGEIF
      4m 15s
    11. Naming and using cell ranges
      3m 45s
  5. 33m 57s
    1. Formatting numbers and dates
      7m 6s
    2. Applying fonts, background colors, and borders
      4m 35s
    3. Adjusting columns, rows, and text
      5m 2s
    4. Using conditional formatting
      4m 6s
    5. Using custom conditional formatting
      5m 49s
    6. Adding pictures and shapes
      7m 19s
  6. 25m 27s
    1. Inserting SmartArt
      6m 54s
    2. Coordinating a look using themes
      3m 22s
    3. Applying built-in styles
      3m 16s
    4. Creating and sharing styles
      5m 33s
    5. Using templates
      4m 9s
    6. Creating and using original templates
      2m 13s
  7. 13m 23s
    1. Making the pieces fit
      4m 57s
    2. Inserting headers and footers
      3m 51s
    3. Printing and PDFs
      4m 35s
  8. 34m 3s
    1. Finding and replacing data
      3m 12s
    2. Freezing panes
      3m 0s
    3. Repeating row and column titles
      3m 34s
    4. Creating multiple custom worksheet views
      5m 18s
    5. Hiding or grouping rows and columns
      5m 31s
    6. Managing worksheets
      7m 23s
    7. Calculating formulas across worksheets
      6m 5s
  9. 36m 34s
    1. Importing and exporting data in Excel
      8m 2s
    2. Setting workbook permissions
      6m 44s
    3. Inserting and editing comments
      6m 49s
    4. Sharing a workbook
      1m 25s
    5. Tracking changes
      3m 5s
    6. Saving files in shared locations
      10m 29s
  10. 27m 30s
    1. Splitting cell data into multiple cells
      2m 22s
    2. Joining data from multiple cells
      4m 18s
    3. Basic and multi-field sorting
      6m 30s
    4. Using tables to sort and filter data
      4m 31s
    5. Inserting automatic subtotals
      3m 46s
    6. Creating lookup tables
      6m 3s
  11. 32m 56s
    1. Using auditing to diagram
      6m 3s
    2. Using evaluation in Excel
      2m 2s
    3. Working with Goal Seek
      5m 29s
    4. Using data tables in formulas
      6m 2s
    5. Using scenarios in formulas
      5m 28s
    6. Exploring the Analysis Toolpak
      7m 52s
  12. 18m 1s
    1. Discovering PivotTables
      2m 22s
    2. Creating a basic PivotTable
      2m 46s
    3. Modifying a PivotTable
      6m 57s
    4. Creating and modifying a PivotChart
      5m 56s
  13. 26m 58s
    1. Choosing chart types
      1m 55s
    2. Inserting Sparklines
      3m 54s
    3. Creating a column chart
      3m 23s
    4. Modifying a column chart
      5m 47s
    5. Creating and modifying a pie chart
      6m 45s
    6. Placing Excel charts into other Office applications
      5m 14s
  14. 21m 53s
    1. Understanding macros
      3m 5s
    2. Recording and using a simple macro
      11m 58s
    3. Editing a macro
      6m 50s
  15. 20m 33s
    1. Customizing the Quick Access toolbar
      3m 30s
    2. Customizing the Ribbon bar
      8m 44s
    3. Setting Excel options
      8m 19s
  16. 16s
    1. Goodbye
      16s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Excel 2010 Essential Training.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.