Query Tutorial1
Query Tutorial1
Instructions for screen readers: After you go through the tip sheets in this tutorial, you'll learn how to quickly master chart elements. The
instructions for each sheet start in cell A1, and each subsequent step is in cell A2, A3, and so on.
The instructions will indicate which cells to navigate to for use of a feature, or further reading.
To start, press CTRL+PAGE DOWN.
Let's go
Go back to top by pressing CTRL+HOME. To start the tour, press CTRL+PAGE DOWN. >
Does this happen to you? You paste data into Excel, but then you have to clean it up. For example, in the data below, there ar
Does this happen to you? You paste data into Excel, but then you have to
First, you might want to split this column into two columns: One for first name, and one for last name...
Youitmight
up.also
Forwantexample,
to remove "12:00in AM"
thefrom
data below,
the last there
column, since are aand
it's repetitive couple things you migh
unnecessary.
To to do...
continue with this tutorial, press CTRL + PAGE DOWN. To go to the previous sheet, press CTRL + PAGE UP.
Previous
ple, in the data below, there are a couple things you might want to do...
ut then you have to clean
le things you might want
RL + PAGE UP.
Next
You could clean up the data manually, but this can be time consuming...
You could fix this byYou
addingcould clean
a new column uplastthe
for the data
names, manually,
and then you could cut but this
and paste thecan be into
last names timethat new c
consuming...
...You could also reformat the last column to exclude "12:00 AM," but that's a lot of work…
To continue with this tutorial, press CTRL + PAGE DOWN. To go to the previous sheet, press CTRL + PAGE UP.
You could fix this by adding a new column for the last
names, and then you could cut and paste the last names
into that new column...
Previous
eis
thecan be into
last names timethat new column…
RL + PAGE UP.
Next
Forget manually cutting, pasting, and reformatting. A better way to clean up data is to use Power Query.
To Forget manually
continue with cutting,
this tutorial, press pasting,
CTRL + PAGE DOWN. Toand reformatting.
go to the previous sheet, pressACTRL
better way
+ PAGE UP. to clean
data is to use Power Query.
Previous
ter way to clean up
Next
What is Power Query? It's a special editor that allows you to clean data so that it's easier to work with.
TheWhat is Power
original data Query?
can be found It's
in cells B11 a special
through D15. editor that allows you to clean data so
Then we used to
easier Power Query with.
work to create the cleaned up data table found in cells H11 through K15.
To continue with this tutorial, press CTRL + PAGE DOWN. To go to the previous sheet, press CTRL + PAGE UP.
Previous
ou to clean data so that it's
RL + PAGE UP.
Next
Another great thing about Power Query: If you add new data that's "dirty," Power Query can clean that up too, with just a clic
Another
Cells great
B7 through D12 thing
contain about
data. There Power
are three columns:Query: If you
Product, Sales add
rep, and new
Order data
date. Each that's
column "dirty,
has various valu
Cells G7 through
Query canJ12 contain
cleandata. Thereup
that are too,
three columns: Product,
with just aFirst
clickname,
ofLast
a name, and Order
button. Trydate. Each column
it out below has
TRY THIS: If you see the Enable Content button at the top of Excel, select it (ALT+F, N). Then type your first and last name into
...Then on the Data tab, click Refresh All (ALT+A, R). You'll see that Power Query added the new row for Kiwis, and it cleaned u
To continue with this tutorial, press CTRL + PAGE DOWN. To go to the previous sheet, press CTRL + PAGE UP.
Product Sales rep Order date Product First Name
Bananas Anne Cho 1/15/18 12:00 AM Bananas Anne
Plums Tim Anders 1/15/18 12:00 AM Plums Tim
Pears Jan Kotas 1/20/18 12:00 AM Pears Jan
Apples Sam Ioto 1/20/18 12:00 AM Apples Sam
Kiwis 11/7/24 12:00 AM Kiwis
Previous
can clean that up too, with just a click of a button. Try it out below!
new
er data
date. Each that's
column "dirty,"
has various Power
values for each row.
me, and Order
utton. Trydate. Each column
it out below! has various values for each row.
hen type your first and last name into cell C12.
he new row for Kiwis, and it cleaned up the data by splitting your first name into cell H12 and your last name into cell I12.
ess CTRL + PAGE UP.
Last Name Order date
Cho 1/15/2018
Anders 1/15/2018
Kotas 1/20/2018
Ioto 1/20/2018
9/16/2021
Next
Why do they call it Power Query? Between the original data, and the clean data, there's a powerful query that links the two.
Why
Cells do they
B7 through calldata.
D11 contain it There
Power Query?
are three columns:Between
Product, Sales the original
rep, and Order date.data, andhasthe
Each column clea
various valu
Cells G7 through
data, J11 contain
there's data. There arequery
a powerful four columns:
thatProduct,
links Firstthe
name, Last name, and Order date. Each column has v
two.
IMPORTANT DETAIL: Between the original data and the clean data, there's a query. The query contains all of the cleaning step
To continue with this tutorial, press CTRL + PAGE DOWN. To go to the previous sheet, press CTRL + PAGE UP.
Product Sales rep Order date Product First name Last name
Bananas Anne Cho 1/15/18 12:00 AM Bananas Anne Cho
Plums Tim Anders 1/15/18 12:00 AM Plums Tim Anders
Pears Jan Kotas 1/20/18 12:00 AM Pears Jan Kotas
Apples Sam Ioto 1/20/18 12:00 AM Apples Sam Ioto
IMPORTANT DETAIL
Between the original data and the clean data, there's a
query. The query contains all of the cleaning steps, so you
don't have to redo them again if new data is added. All
you have to do is click Refresh, and Power Query cleans it
up automatically.
Previous
rful query that links the two.
.data, andhasthe
Each column clean
various values for each row.
Order date. Each column has various values for each row.
ontains all of the cleaning steps, so you don't have to redo them again if new data is added. All you have to do is select Refresh (Alt+A, R),
L + PAGE UP.
Order date
1/15/2018
1/15/2018
1/20/2018
1/20/2018
Next
s select Refresh (Alt+A, R), and Power Query cleans it up automatically.
There are three main steps to using Power Query: Get Data, Transform, and Load.
To There arethisthree
continue with tutorial, main steps
press CTRL to using
+ PAGE DOWN. Power
To go to Query:
the previous Get
sheet, press Data,
CTRL + PAGE Transform,
UP. a
Load.
Previous
Data,
+ PAGE Transform,
UP. and
Next
The first step is Get Data. This is simply the process of getting your data into Power Query. We'll show you how this works in th
To The
continue first step
with this is Get
tutorial, Data.
press CTRL This
+ PAGE DOWN. isTosimply the process
go to the previous sheet, press of
CTRLgetting
+ PAGE UP. your data
Power Query. We'll show you how this works in the videos coming up.
Previous
show you how this works in the videos coming up.
getting
+ PAGE UP. your data into
os coming up.
Next
Transform
EXCEL SPEAK: Why theisword,
the"Transform?"
second Well, step,
you where
can do moreyou use
than just Power
clean the data.Query toortransform,
You can add remove columns, o
fi
To clean
continue with
thethisdata.
tutorial,We'll
press CTRL + PAGE
walk DOWN.
you To go to thethis
through previous
in sheet,
the press CTRL + PAGEvideos
upcoming UP. as we
EXCEL SPEAK
Why the word, "Transform?" Well, you can do more
clean the data. You can add or remove columns, filte
custom calculations, and a lot more.
Previous
ery toortransform,
an add remove columns, or,
filter, add custom calculations, and a lot more.
+ PAGEvideos
ming UP. as well.
Next
And finally, Loading is the last step. This is the act of returning the cleaned-up, transformed data back into Excel.
To And
continuefinally, Loading
with this tutorial, is the
press CTRL + PAGElast
DOWN. step. This
To go to is the
the previous actpress
sheet, ofCTRL
returning
+ PAGE UP. the cleane
up, transformed data back into Excel.
Previous
back into Excel.
turning
+ PAGE UP. the cleaned-
Next
And keep in mind: Power Query isn't just for cleaning up pasted data. You can import and transform data from other sources,
And keep in mind: Power Query isn't just for cleaning up pasted data. You
Cells F9 through I14 contain data. There are four columns: Year, Champions, Runners-up, Third place. Each column has various
import
CHECK and
THIS OUT: transform
In this example we useddata
Powerfrom
Query toother
get data sources, like
from Wikipedia's FIFAa file,
World Cupapage.
database, or oe
You can imagine
To web
continuepage.
with this tutorial, press CTRL + PAGE DOWN. To go to the previous sheet, press CTRL + PAGE UP.
Year
2002 Champions Runners-up Third place
2006 Brazil Germany Turkey
2010 Italy France Germany
2014 Spain Netherlands Germany
2018 Germany Argentina Netherlands
France Croatia Belgium
Previous
d transform data from other sources, like a file, a database, or even a web page.
ng up pasted data. You can
Third place. Each column has various values for each row.
AaWorld
file,
Cupapage.
database, or other
You can imagine even usefula sources you might pull data from.
ess CTRL + PAGE UP.
CHECK THIS
OUT
In this example we used
Power Query to get
data from Wikipedia's
FIFA World Cup page.
You can imagine other
useful sources you
might pull data from.
Next
Before we show you how to use Power Query, we should warn you that its window, called the Power Query Editor, is large an
Before we show you how to use Power Query, it's worth noting that its
GOOD TO KNOW: You can't use the Excel window while the Power Query Editor is open. However, once you're done transform
To window, called
continue with this tutorial,the
pressPower Query
CTRL + PAGE Editor,
DOWN. To is large
go to the previous and
sheet, pressmay cover
CTRL + PAGE UP. Excel. Thi
expected.
GOOD TO KNOW
You can't use the Excel w
while the Power Query E
open. However, once you
done transforming the d
you can close the editor.
point, you'll able to work
Excel window again.
Previous
ower Query Editor, is large and may cover Excel. This is expected.
noting that its
r, once you're done transforming the data, you can close the editor. At that point, you'll able to work in the Excel window again.
y+ PAGE
cover UP. Excel. This is
GOOD TO KNOW
You can't use the Excel window
while the Power Query Editor is
open. However, once you're
done transforming the data,
you can close the editor. At that
point, you'll able to work in the
Excel window again.
Next
Excel window again.
In fact, if you have two monitors, we recommend moving the Power Query Editor window to the second monitor so that you c
In fact, if you have two monitors, we recommend moving the Power Quer
Two monitors side by side with Excel opened on one and Power Query editor on the other.
Editor
If you have twowindow tothethe
monitors, put Excelsecond monitor so that you can view Excel at the sa
window in one…
time
... and forPower
put the reference.
Query Editor in the other.
To continue with this tutorial, press CTRL + PAGE DOWN. To go to the previous sheet, press CTRL + PAGE UP.
Previous
second monitor so that you can view Excel at the same time for reference.
ng the Power Query
ew Excel at the same
+ PAGE UP.
ower Query
r
her.
Next
Start the videos
Start the videos
1. Take a look at the sheets at the bottom of this workbook. You'll see sheets for Import data from web, Categories, and Sales
2. Where are the videos? They'll appear in a web browser after you click the link in step 4.
3. Keep in mind, there are several videos, so make sure to bookmark the page. That way you can return to them in case you ne
1 the
4. Watch
Take a look at the
Power 2 Where are the 3 Keep in mind, there 4
sheets at Query
the videos. videos? They'll are several videos, so
To continue with this
bottom tutorial, press CTRL + PAGE
of this DOWN.
appear in a To
webgo to the previous sheet,
make press CTRL + PAGE UP.
sure to
workbook. You'll see browser after you bookmark the page.
sheets for Import click the link in step That way you can
data from web, 4. return to them in case
Categories, and you need to take a
Sales Data ... You'll break.
work with these
sheets while you
watch the videos.
Previous
m web, Categories, and Sales Data ... You'll work with these sheets while you watch the videos.
Next
Copy this URL:
https://en.wikipedia.org/wiki/FIFA_World_Cup
Product Name Category
Apples Produce
Beer Beverages
Coffee Beverages
Green Tea Beverages
Pears Produce
Plums Produce
txt_ProdNam txt_SalesRep dt_OrderDate dbl_Sales
Beer Anne Hellung-Larsen 1/15/2018 0:00 14,000.36
Plums Anne Hellung-Larsen 1/15/2018 0:00 1,050.42
Total Sales Rep 15,050.78
Pears Jan Kotas 1/20/2018 0:00 3,000.51
Apples Jan Kotas 2/20/2018 0:00 5,300.04
Plums Jan Kotas 2/20/2018 0:00 350.13
Total Sales Rep 8,650.68
Coffee Mariya Sergienko 2/27/2018 0:00 9,200.97
Total Sales Rep 9,200.97
Green Tea Anne Hellung-Larsen 3/10/2018 0:00 13,800.89
Total Sales Rep 13,800.89
Coffee Mariya Sergienko 3/24/2018 0:00 5,980.40
Total Sales Rep 5,980.40
Beer Nancy Freehafer 4/5/2018 0:00 12,180.68
Total Sales Rep 12,180.68
Beer Michael Neipper 4/8/2018 0:00 42,000.42
Total Sales Rep 42,000.42
Apples Mariya Sergienko 5/24/2018 0:00 2,000.39
Plums Nancy Freehafer 5/24/2018 0:00 52.50
Coffee Nancy Freehafer 6/7/2018 0:00 2,300.20
Total Sales Rep 4,353.09
Apples Andrew Cencini 6/23/2018 0:00 15,900.61
Pears Andrew Cencini 6/23/2018 0:00 9,000.24
Total Sales Rep 24,900.85