Kinds of data
A number that is really a label
Pupil numbers, phone numbers and postcodes are written with digits but are labels, so adding or averaging them gives nonsense.
By the end of this lesson you can spot phone numbers, IDs and postcodes that look like numbers but are labels.
Why it matters
A spreadsheet will happily add up anything made of digits. It will not warn you that the answer is silly. You are the one who must know when a sum makes sense. This lesson gives you a one-question test.
The idea in plain words
Think of the numbers on football shirts. Player 10 is not "twice as good" as player 5. Adding 10 + 5 does not give you anything useful. The number is just a name written with digits.
Many columns are like that. Lucía's pupil_number holds 4101, 4109 and so on. The school uses them as name tags. They are labels, even though they are made of digits.
Identifier (ID): a label that picks out one row, such as a pupil number or Amara's
sale_id. It tells you which one, never how much.
The one-question test: would it mean anything to add these up?
- Adding
travel_minutesgives the total minutes spent travelling. It means something: an amount. - Adding
pupil_numbergives ... nothing you can use. It is a label.
Phone numbers, house numbers and bus routes are written in digits, but they are labels.
See it done
Data:
class-survey.csv(synthetic), column A,pupil_number.
Question: what happens if you add up the pupil numbers?
- Click an empty cell, such as K2.
- Type the formula
=SUM(A2:A31)and press Enter. (SUMadds up every number in the cells from A2 to A31. You will learn it properly in Module 3.) - Read the answer: 125194.
- Apply the test. Does 125194 count or measure anything about Lucía's class? No. It is not the number of pupils (that is 30). It is not anyone's age or time. It is a real number that means nothing.
- Decide.
pupil_numberis a label. Delete the formula (click K2 and press Delete).
The spreadsheet did the sum perfectly. The sum just has no meaning.
There is a second danger with labels in digits: leading zeros. Many phone numbers start with 0, such as 07000000001 (a made-up number). To a computer, 07000000001 and 7000000001 are the same number. So if a spreadsheet turns that label into a number, the 0 at the front disappears, and the phone number is broken.
Your turn, with help
Amara's sheet has a sale_id column (S001, S002 ...). Is it an amount or a label?
Hint: use the one-question test. Would it mean anything to add S001 and S002?
Check the answer
A label (an ID). It picks out one sale. It never tells you how much. It also has a letter in it, which is a clue, but labels made only of digits exist too.
Your turn, alone
Amount or label?
- A postcode such as 100001.
- The number of pupils in a class.
- A bus route number, 42.
- The price of one pineapple, ₦1,500.
- Why might a list of Nigerian phone numbers lose its first digit in a spreadsheet?
Check your answers
- Label.
- Amount (a count).
- Label.
- Amount (money: adding prices gives a total cost).
- Nigerian mobile numbers usually start with 0. If the spreadsheet turns them into numbers, the leading 0 is dropped, because 0 at the front does not change a number's value.
Watch out
- Trusting the spreadsheet to know. It will sum, average and chart labels without any warning. Use the test every time.
- Lost zeros. Codes and phone numbers that start with 0 can lose it. Check a few by eye after you import.
- Long numbers turning odd. Very long codes, such as bank card or ID numbers, can show up rounded or in a short form like 1.23E+15. That is another sign they are labels and should be kept as text.
Say it back
- What is the one-question test for amounts and labels?
- Is a pupil number an amount or a label?
- Why can a leading zero disappear?
Show the answers
- Would it mean anything to add them up?
- A label (an identifier).
- When a label is turned into a number, a 0 at the front does not change its value, so it is dropped.
What is next
You can now name every kind of data in a table: counts, measurements, categories, ordered categories, dates, blanks and labels. That ends Module 2. In Module 3, you start asking the data questions, and you meet the formulas that answer them in a blink.