1. Data types for data science
Hi, I'm Richie, a Data Evangelist at DataCamp. The main purpose of this course is to expand your spreadsheet vocabulary. You're going to see a lot of new functions that will come in handy in future courses.
2. Calculating the mean, badly
Let's start with an easy problem, calculating the mean of 5 numbers.
You type equals to denote a formula, call the AVERAGE() function, and pass it the range of cells containing the numbers.
Unfortunately, something's gone wrong. The answer ought to be about 33, not 34. Pause the video and see if you can spot what the problem is.
3. What went wrong?
Did you find the problem? In the fourth number, at the sixth decimal place, a number one is actually the letter "I". That means that the spreadsheet ignores that cell when it makes the calculation.
4. Please don't stare!
When you only have five rows of data, it isn't too tricky to locate the problem. If you have five thousand rows of data, it's much harder. If you have to stare at every single cell in a workbook that big, you'll quickly go spreadsheet-blind.
5. The 4 common data types
Before we get to the solution, let's quickly take a look at the most common types of data that you'll encounter in a spreadsheet. There are only four of them, namely numbers, text, dates, and logical. Logical data contains TRUE and FALSE values.
6. ISNUMBER() checks if a cell contains a number
You can test for different types of data using functions that begin with "IS". For example, ISNUMBER() takes a cell location as an input, and returns TRUE if that cell contains a number, and FALSE otherwise. This allows you to be sure that your cells contain the type of data that you thought they did.
7. Other "IS" functions for checking types
Similarly, ISTEXT() checks for text data, ISDATE() checks for date data, and ISLOGICAL() checks for logical data. Easy!
8. Checking cell properties and rarer types
In addition to checking for the four common data types, there are some other checks that you will encounter in this chapter. You can check if the text in a cell is a web address using ISURL() and you can check for formulas using ISFORMULA().
9. Copying formulas between cells
One Google Sheets technique that you need to know throughout this course is how to copy a formula across cells. When you select a cell, it has a blue square in the bottom-right hand corner. Click that square and drag it to copy the formula to new cells.
Alternatively, you can select both the cell containing the formula and the cells that you want to copy to and press Control and "R" to copy right, or Control and "D" to copy down. If you use macOS, the equivalent commands are Command and "R", or Command and "D".
10. Let's go!
Alrighty! Let's get started!