Pull cryptocurrency prices in Google Sheets (2 methods) | GOOGLEFINANCE and IMPORTXML crypto prices

Spreadsheet Class · Intermediate ·📊 Data Analytics & Business Intelligence ·4y ago
Check out this new method for pulling crypto prices: https://youtu.be/YKn0mTpxGjk Get help with your spreadsheet project, or personalized training: https://www.spreadsheetclass.com/consulting/ Get the ultimate formulas cheat sheet https://www.spreadsheetclass.com/best-google-sheets-cheat-sheet/ Learn to build dashboards in Google Sheets: https://www.spreadsheetclass.com/google-sheets-dashboards-course/ Note that some websites will block "bots" which affects the IMPORTXML function, but the new method in the video above does not have an issue with this. Learn more about using IMPORTXML: https://www.youtube.com/watch?v=U7XXxtobXcA Learn to pull stock prices: https://youtu.be/Cd-DlJdWbsg In this video I am going to teach you two different ways to pull cryptocurrency prices into Google Sheets. First I will show you how to use the GOOGLEFINANCE function to pull crypto prices, and then I will show you how to use the IMPORTXML function to pull crypto prices into your Google spreadsheet. Check out the video linked above to learn more about using the IMPORTXML function.

What You'll Learn

The video demonstrates two methods for pulling cryptocurrency prices in Google Sheets using GOOGLEFINANCE and IMPORTXML functions, with a focus on web scraping and data analytics.

Full Transcript

hey everybody it's corey from spreadsheet class today i'm going to show you two different ways that you can pull crypto prices into your google spreadsheet by using google sheets formulas now the first method is much more simple but it's also much more limited on which cryptocurrencies you can display the price of the second method is more advanced but you can pretty much pull any different crypto price that you want with it so first let's go over the simple method which is by using the google finance function a lot of people use the google finance function to pull stock prices but you can also use it to pull the prices of a couple different cryptocurrencies such as bitcoin and ethereum now honestly i'm not sure if there's any other cryptocurrencies that this works with but it definitely works with bitcoin and ethereum and so here's how you use the google finance function to pull crypto prices so as you can see here in cell t3 the blue cell i've entered the formula equals google finance r3 we're referring to cell r3 as the criteria for the google finance function and so what we're basically saying is show me the price of bitcoin and for the purposes of this formula the symbol that google sheets will expect for bitcoin is btc usd that represents the bitcoin us dollars pair now the same thing can be done for ethereum by using the symbol eth usd now if we wanted we could simply type these symbols directly into the formula by typing a quotation mark and then typing btc usd and then a quotation mark and we would get the same result but it's nice to be able to use cell references so that you can simply change the symbol in the cell which will also change the resulted formula and so again we can simply refer to a cell with the google finance function where the cell that we're referring to has the symbol that the formula expects now in a different video i'll go over the google finance function in more detail with traditional stocks because there's actually a lot of different things you can do with the google finance function beyond just showing the current price but here we're just sticking to pulling the current price of a cryptocurrency and if you don't specify any additional criteria the default of this function will simply show the current price this method is the more simple one but it's more limited on the cryptocurrencies that it can cool and so i'm going to show you a more advanced method which is by using the import xml function which pulls data directly off of different websites you can specify an element from a website that you want to pull information from into your google spreadsheet so i'm going to go over that pretty quickly here but i have a video of where i go over this in greater detail and so if you feel like this is going kind of fast that's because i have a different video that you can watch which i've linked in the description below so again the next method for pulling crypto prices into your google spreadsheet is by using the import xml function so as you can see here in cell y6 the blue cell we're using the import xml function to pull the price of loop ring cryptocurrency from coinbase into our google spreadsheet and so the import xml function has two different things that it needs it needs the url for the website that you're pulling information from which in this case is coinbase and then it also needs what's called an x path which is basically an address that tells where on the web page to pull the information from and both of these things we can easily copy and paste from the web page that we want to pull the information from so i'm going to show you how to do that right now so i'm going to delete the formula in cell y6 so that we can recreate it together and then i'm going to coinbase.com to the price quote for loop ring coinbase.com price slash loop ring and again this url at the top is something that we're going to need to copy and paste into our formula but we'll get there in just a second the next thing that we need to copy from this website is the x path for the element that contains the price each web page consists of a bunch of different elements each button is an element each toolbar is an element each table and so there's something called an xpath which is basically like an address and we can copy the x path from this price quote right here to use in our google sheets formula and so we can fairly easily copy this x path and what we do is hover our cursor over the element that we want to pull information from and then right click and then click inspect now a bar has popped up on the right and as you can see there's a bunch of code here and you don't need to worry about what the code does we just need to know the element that it represents now in this case as you can see if you look off to the left the numbers .07 are highlighted and so we want to pull in more than just the .07 we want to pull in the whole price and so i'm going to drag my cursor upwards through this code and as you can see when i do this if you look on the left the element that's highlighted changes so i'm going to go up even more a little bit more and so now when i hover my cursor over this section of the code you can see off to the left that all of the numbers are highlighted and so this is the element that i want to copy the x path of so sometimes the element that you've right clicked on is not the exact element that you want to pull from but it will bring up the code and you'll be very close to the place that you want to pull from and again just drag your cursor up and down and look to see what it highlights on the web page and then you'll know when you've captured the right element so again here where it says div data test id asset overview price well that makes sense asset overview price but anyways this is the element that i want so i'm going to right click on this element then i'm going to hover my cursor over copy and then i'm going to click copy full xpath make sure you click copy full xpath now i've copied this code to my clipboard which is an address to this element which contains the price and i'm going to copy it or paste it into my spreadsheet formula so i'm going back to my spreadsheet and just as a temporary placeholder so that it's ready for me i'm going to paste the xpath that i just copied into cell z6 then i'll reduce the size so you can see what it looks like again it's nothing that you need to worry about how all this works you just need the code i'm just putting it here temporarily because i need to go back and copy the url and then i'll be ready to enter my formula so i'm going to copy the url from coinbase which is here on the top coinbase.com price slash loop ring now i'm going back to my spreadsheet and i have all of the information that i need to enter my formula so i'm going to click on cell y6 and then i'm going to type equals import xml parentheses now you can see that it's asking for a url and we've just copied that to the clipboard so i'm going to type a quotation mark and then paste the url then type another quotation mark now i'm going to type a comma and now the formula is asking us for an xpath query so just temporarily so that i can copy the xpath that's in that cell to the right i'm just going to press enter even though the formula is not complete and then i'm going to copy cell z6 which copies this code right here i'm going back to my formula and again it's asking for the x path after we've typed our comma so i'm going to type a quotation mark paste the x path and then type another quotation mark and then press enter and i'm going to delete my x path from cell z6 and now my information has popped up and so now we're pulling data directly from the coinbase website into our google spreadsheet which is really really cool but as you can see in this particular case the element that we pulled data from was three different columns it's showing the dollar sign in one column the dollar amount in another column and the number of cents in another column and that's really easy to deal with so here in cell t6 i've simply entered the formula equals z6 plus aa6 to add the dollar amount plus the amount of cents and so different websites create their pages in different ways sometimes such as this formula here in cell t5 when you pull from a website's single element it will pull exactly how you want it with the dollar amount plus the cents and the dollar sign all in one element but sometimes again it splits into different columns and you simply have to look at what the result is and whatever you need to do to retrieve the correct data such as adding these two cells together now again in the other video where i go over the import xml formula we go over this in a little more detail so check out that video if you want some more detail but now you know two different ways to pull crypto prices which is with the google finance function or with the import xml function
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Spreadsheet Class · Spreadsheet Class · 47 of 60

1 How to use the FILTER function in Google Sheets (Single or Multiple Conditions)
How to use the FILTER function in Google Sheets (Single or Multiple Conditions)
Spreadsheet Class
2 5 formulas that combine columns in Google Sheets (Horizontal and Vertical)
5 formulas that combine columns in Google Sheets (Horizontal and Vertical)
Spreadsheet Class
3 All the ways to extract text and numbers in Google Sheets
All the ways to extract text and numbers in Google Sheets
Spreadsheet Class
4 How to filter based on a list in Google Sheets
How to filter based on a list in Google Sheets
Spreadsheet Class
5 How to fix the "FILTER has mismatched range sizes" error in Google Sheets
How to fix the "FILTER has mismatched range sizes" error in Google Sheets
Spreadsheet Class
6 How to color cells, and alternate row colors in Google Sheets
How to color cells, and alternate row colors in Google Sheets
Spreadsheet Class
7 How to automatically create a series of values in Google Sheets
How to automatically create a series of values in Google Sheets
Spreadsheet Class
8 Google Sheets Beginner Tutorial
Google Sheets Beginner Tutorial
Spreadsheet Class
9 How to make a Dashboard in Google Sheets (Full Tutorial)
How to make a Dashboard in Google Sheets (Full Tutorial)
Spreadsheet Class
10 Using the SORT and FILTER function in the same formula in Google Sheets
Using the SORT and FILTER function in the same formula in Google Sheets
Spreadsheet Class
11 ARRAYFORMULA function: Apply a formula to an entire column in Google Sheets
ARRAYFORMULA function: Apply a formula to an entire column in Google Sheets
Spreadsheet Class
12 Automatically resize columns in Google Sheets with Fit to Data
Automatically resize columns in Google Sheets with Fit to Data
Spreadsheet Class
13 How to import or convert a CSV file into Google Sheets
How to import or convert a CSV file into Google Sheets
Spreadsheet Class
14 How to export / download a CSV from Google Sheets
How to export / download a CSV from Google Sheets
Spreadsheet Class
15 How to change text case in Google Sheets  with UPPER LOWER and PROPER
How to change text case in Google Sheets with UPPER LOWER and PROPER
Spreadsheet Class
16 How to use the Calendar Template in Google Sheets
How to use the Calendar Template in Google Sheets
Spreadsheet Class
17 How to rotate text in Google Sheets
How to rotate text in Google Sheets
Spreadsheet Class
18 How to create charts in Google Sheets (And how to customize them too)
How to create charts in Google Sheets (And how to customize them too)
Spreadsheet Class
19 How to copy formulas, and lock cell references in Google Sheets (Relative & absolute references)
How to copy formulas, and lock cell references in Google Sheets (Relative & absolute references)
Spreadsheet Class
20 How to copy and paste values only in Google Sheets
How to copy and paste values only in Google Sheets
Spreadsheet Class
21 How to fix the "Circular Dependency Detected" error in Google Sheets
How to fix the "Circular Dependency Detected" error in Google Sheets
Spreadsheet Class
22 Evenly space columns in Google Sheets (Make columns the same size quickly)
Evenly space columns in Google Sheets (Make columns the same size quickly)
Spreadsheet Class
23 Doing math in Google Sheets: Add, Sum, Subtract, Multiply, Divide, Square, Square Root
Doing math in Google Sheets: Add, Sum, Subtract, Multiply, Divide, Square, Square Root
Spreadsheet Class
24 How to filter horizontally in Google Sheets (Filter columns)
How to filter horizontally in Google Sheets (Filter columns)
Spreadsheet Class
25 UNIQUE function: Removing duplicates with 2 methods in Google Sheets
UNIQUE function: Removing duplicates with 2 methods in Google Sheets
Spreadsheet Class
26 Report Builder template for Google Sheets (Automatically organize / calculate your data)
Report Builder template for Google Sheets (Automatically organize / calculate your data)
Spreadsheet Class
27 Build a Google Sheets dashboard with Google Forms data (Automated)
Build a Google Sheets dashboard with Google Forms data (Automated)
Spreadsheet Class
28 Guitar tabs template for Google Sheets (& PDF) | Create your songs in a Google spreadsheet
Guitar tabs template for Google Sheets (& PDF) | Create your songs in a Google spreadsheet
Spreadsheet Class
29 Interactive Google Sheets dashboard with drop down menus tutorial
Interactive Google Sheets dashboard with drop down menus tutorial
Spreadsheet Class
30 Student attendance dashboard tutorial in Google Sheets: Simple + advanced
Student attendance dashboard tutorial in Google Sheets: Simple + advanced
Spreadsheet Class
31 SORT function in Google Sheets (Sort data vertically or horizontally)
SORT function in Google Sheets (Sort data vertically or horizontally)
Spreadsheet Class
32 How to use the SORT function in Google Sheets (Quick Version)
How to use the SORT function in Google Sheets (Quick Version)
Spreadsheet Class
33 How to copy chart formatting and duplicate charts in Google Sheets
How to copy chart formatting and duplicate charts in Google Sheets
Spreadsheet Class
34 How to copy a tab to a new file / sheet in Google Sheets
How to copy a tab to a new file / sheet in Google Sheets
Spreadsheet Class
35 How to duplicate tabs in Google Sheets
How to duplicate tabs in Google Sheets
Spreadsheet Class
36 How to hide and unhide tabs in Google Sheets
How to hide and unhide tabs in Google Sheets
Spreadsheet Class
37 How to make a copy of a file in Google Sheets
How to make a copy of a file in Google Sheets
Spreadsheet Class
38 How to change tab color in Google Sheets
How to change tab color in Google Sheets
Spreadsheet Class
39 How to insert, delete, rename, and reorder tabs in Google Sheets
How to insert, delete, rename, and reorder tabs in Google Sheets
Spreadsheet Class
40 How to move a chart to another sheet in Google Sheets
How to move a chart to another sheet in Google Sheets
Spreadsheet Class
41 How to wrap text, unwrap text, and clip text in Google Sheets
How to wrap text, unwrap text, and clip text in Google Sheets
Spreadsheet Class
42 Switch columns and rows with the TRANSPOSE function in Google Sheets
Switch columns and rows with the TRANSPOSE function in Google Sheets
Spreadsheet Class
43 Project management timeline template for Google Sheets (Gantt Chart)
Project management timeline template for Google Sheets (Gantt Chart)
Spreadsheet Class
44 Build a dashboard in 3 simple steps (Google Sheets)
Build a dashboard in 3 simple steps (Google Sheets)
Spreadsheet Class
45 Pull data from websites in Google Sheets with IMPORTXML function | Web scraping (Stock prices)
Pull data from websites in Google Sheets with IMPORTXML function | Web scraping (Stock prices)
Spreadsheet Class
46 (Quick version) Pulling data from websites with IMPORTXML function | Google Sheets web scraping
(Quick version) Pulling data from websites with IMPORTXML function | Google Sheets web scraping
Spreadsheet Class
Pull cryptocurrency prices in Google Sheets (2 methods) | GOOGLEFINANCE and IMPORTXML crypto prices
Pull cryptocurrency prices in Google Sheets (2 methods) | GOOGLEFINANCE and IMPORTXML crypto prices
Spreadsheet Class
48 Fast & simple dashboard tutorial for Google Sheets (Build in under 15 minutes)
Fast & simple dashboard tutorial for Google Sheets (Build in under 15 minutes)
Spreadsheet Class
49 How to create drop-down lists in Google Sheets (Data validation)
How to create drop-down lists in Google Sheets (Data validation)
Spreadsheet Class
50 The ultimate cheat sheet for Google Sheets (Formulas, charts, shortcuts, and more)
The ultimate cheat sheet for Google Sheets (Formulas, charts, shortcuts, and more)
Spreadsheet Class
51 3 ways to pull crypto prices into Google Sheets | GOOGLEFINANCE, IMPORTXML, IMPORTDATA
3 ways to pull crypto prices into Google Sheets | GOOGLEFINANCE, IMPORTXML, IMPORTDATA
Spreadsheet Class
52 Stock & crypto tracker templates for Google Sheets (Portfolio, Analysis, Watchlist, Screener)
Stock & crypto tracker templates for Google Sheets (Portfolio, Analysis, Watchlist, Screener)
Spreadsheet Class
53 How to indent in Google Sheets (5 Methods)
How to indent in Google Sheets (5 Methods)
Spreadsheet Class
54 Pull stock prices & stock data with the GOOGLEFINANCE function in Google Sheets (& Crypto too)
Pull stock prices & stock data with the GOOGLEFINANCE function in Google Sheets (& Crypto too)
Spreadsheet Class
55 How to create and customize charts in Google Sheets (Quick version)
How to create and customize charts in Google Sheets (Quick version)
Spreadsheet Class
56 Apply a formula to an entire column in Google Sheets with the ARRAYFORMULA function | Quick Version
Apply a formula to an entire column in Google Sheets with the ARRAYFORMULA function | Quick Version
Spreadsheet Class
57 How to insert a new line in a cell (or formula) in Google Sheets
How to insert a new line in a cell (or formula) in Google Sheets
Spreadsheet Class
58 How to freeze rows & columns (& How to unfreeze) in Google Sheets
How to freeze rows & columns (& How to unfreeze) in Google Sheets
Spreadsheet Class
59 How to add and sum in Google Sheets (Addition and SUM function)
How to add and sum in Google Sheets (Addition and SUM function)
Spreadsheet Class
60 How to average in Google Sheets (Using the AVERAGE function)
How to average in Google Sheets (Using the AVERAGE function)
Spreadsheet Class

This video teaches how to pull cryptocurrency prices in Google Sheets using two methods: GOOGLEFINANCE and IMPORTXML functions. It covers web scraping, XPath, and data analytics in Google Sheets.

Key Takeaways
  1. Delete formula in cell Y6
  2. Copy URL from Coinbase website
  3. Copy XPath from Coinbase website
  4. Paste XPath into Google Sheets formula
  5. Type equals IMPORTXML in cell Y6
  6. Copy the xpath to the right
  7. Paste the xpath into the formula
  8. Delete the x path from cell Z6
  9. Add the dollar amount and cents together
💡 Different websites create pages in different ways, so it's necessary to adjust the formula to get the correct data.

Related AI Lessons

The Nervous System of the Telco: Unlocking the Real-Time Power of the Network Element Interfaces…
Unlock the power of network element interfaces to enable real-time insights in telco operations
Medium · Data Science
Enhanced RFM Analysis for Customer Segmentation using K-Prototypes
Learn how to enhance RFM analysis for customer segmentation using K-Prototypes, a clustering algorithm that handles categorical and numerical data, to improve marketing strategies and customer targeting.
Medium · Machine Learning
One Survey Asked Rich People Ten Times More Often Than Poor People.
Learn how a biased survey sample can impact data analysis and decision-making, and why it's crucial to ensure representative sampling in data science
Medium · Data Science
Data Cleaning Fundamentals: Building a Reproducible Data Cleaning Pipeline
Learn to build a reproducible data cleaning pipeline to transform raw data into analysis-ready datasets
Medium · Data Science
Up next
Spreadsheet Guy Meets the CFO: "Define How Much"
Digital Transformation with Eric Kimberling
Watch →