Why every privacy project starts with one boring question
Somebody asks you for "just the survey data, without the names". A research partner wants to study asthma and doctor visits, a vendor needs realistic test data, or a colleague in another department wants to build a dashboard. Deleting the name column feels like enough. It almost never is. The person who is left in the file can still be the only 37-year-old female teacher in ZIP code 80331, and anybody who knows that one fact about her now also knows her diagnosis.
This free first lesson is for analysts, researchers, data stewards, HR and finance teams, and anyone else who shares spreadsheets that contain information about people. It teaches the first step of every anonymisation project, and the step people skip most often: going through the columns one by one and deciding what kind of risk each column carries. Once you can tell a direct identifier from a quasi-identifier and a sensitive attribute, every later technique (pseudonyms, age bands, k-anonymity, suppression) has a clear target.
We use the same fictional dataset as the lab above, the Larkfield Community Health Survey, with twelve columns from full name to satisfaction score. All names and values are synthetic. The course teaches techniques, it is educational and not legal advice, and the person who decides what applies to your organisation is your data protection officer or legal counsel.
The core concept: three kinds of columns
Ask one question of every column: could this value, alone or together with others, point to a specific person? The answer sorts the columns into three groups, plus a fourth for everything else.
- Direct identifiers identify a person on their own: full name, email address, phone number, a patient, customer or employee number, a national ID, an exact street address. You remove them or replace them with a pseudonym before the data leaves the team that collected it.
- Quasi-identifiers are harmless alone and identifying in combination: date of birth, gender, ZIP code, occupation, marital status, sometimes nationality or job title. Thousands of people share your birth year, but very few share your birth date, your gender and your ZIP code at the same time. These are the columns that later techniques make less precise.
- Sensitive attributes are the information that must not be linked to a person: a diagnosis, a salary, a disciplinary record, a political or religious view. They are usually the reason for the analysis, so you keep them and protect them indirectly, by making sure nobody can find out which row belongs to whom.
- Other columns carry little linkage risk in this dataset, for example a satisfaction score or the number of visits. "Other" is a judgement, not a guarantee: a rare value can still stand out, and you revisit the decision when the data or the audience changes.
Why does the distinction matter so much? Because the protections are different. Direct identifiers are handled by deletion or pseudonymisation. Quasi-identifiers are handled by generalisation and suppression, measured with k-anonymity. Sensitive attributes are checked with l-diversity, so that a group of look-alike records does not all share the same secret. If a column is put in the wrong group, it gets the wrong protection, and the release fails quietly.
The well-known result behind this is quoted in the lab theory: Latanya Sweeney estimated that about 87% of the US population was unique by 5-digit ZIP code, gender and full date of birth. Later public cases made the point again. In 2006 AOL published "anonymised" search logs that journalists traced back to individual users, and in 2008 researchers showed that parts of the Netflix Prize ratings could be linked to public movie reviews. In each case the obvious identifiers were gone. The combination of the remaining columns was the problem.
Worked example: classifying the Larkfield survey
Here is the complete classification for the lab sheet, with a one-line reason for every decision. In the lab, column C already contains most answers. You fill in the three missing ones (C3, C8 and C11) and count the quasi-identifiers in C15.
| Row | Attribute | Example value | Type | Why |
|---|---|---|---|---|
| 2 | Full name | Maria Okafor | Direct | Names one person on its own |
| 3 | Email address | m.okafor@example.com | Direct (task C3) | An inbox belongs to one person |
| 4 | Phone number | +1 555 0142 | Direct | Reaches one person or household |
| 5 | Patient number | LH-20417 | Direct | Internal ID, still points to one patient |
| 6 | Date of birth | 14 Mar 1987 | Quasi | Shared by many, identifying in combination |
| 7 | Gender | Female | Quasi | Splits every group roughly in half |
| 8 | ZIP code | 80331 | Quasi (task C8) | Location, linkable to public lists |
| 9 | Occupation | Teacher | Quasi | Rare jobs narrow a group fast |
| 10 | Marital status | Married | Quasi | Often known to neighbours and colleagues |
| 11 | Diagnosis | Asthma | Sensitive (task C11) | The secret the release must protect |
| 12 | Visits last year | 2 | Other | Analysis variable, low linkage risk here |
| 13 | Satisfaction score (1-10) | 8 | Other | Opinion score, not identifying here |
The count in C15 uses =COUNTIF(C2:C13,"Quasi*"). The asterisk is a wildcard for "any text", so the formula counts "Quasi" as well as "Quasi-identifier" or "Quasi ID", whichever spelling a colleague used. For the survey the result is 5: date of birth, gender, ZIP code, occupation and marital status. That number is not trivia. The more quasi-identifiers a release contains, the more combinations exist and the more people become unique, which is exactly what the next example shows.
Two decisions in the table are worth a closer look. The patient number LH-20417 looks harmless because outsiders cannot read it, but inside the clinic it leads straight to one file. Internal IDs are direct identifiers. And the satisfaction score is "Other" only for this audience: if the survey also contained free-text comments, those would need their own review, because people often write their own names, their doctor's name or their street into comment boxes.
How fast combinations become unique
To see why quasi-identifiers matter, take a small fictional extract of twelve respondents with three quasi-identifiers (ZIP, gender, birth year) and one sensitive attribute (diagnosis). For each row we count how many rows share the same values. In Excel the counts in columns F, G and H come from COUNTIFS with absolute ranges:
- F2:
=COUNTIF($B$2:$B$13,B2)(same ZIP) - G2:
=COUNTIFS($B$2:$B$13,B2,$C$2:$C$13,C2)(same ZIP and gender) - H2:
=COUNTIFS($B$2:$B$13,B2,$C$2:$C$13,C2,$D$2:$D$13,D2)(same ZIP, gender and birth year) - Unique respondents:
=COUNTIF(H2:H13,1), and the same for F and G
| ID | ZIP | Gender | Birth year | Diagnosis | Same ZIP | Same ZIP + gender | Same ZIP + gender + year |
|---|---|---|---|---|---|---|---|
| R01 | 80331 | F | 1987 | Asthma | 4 | 2 | 1 |
| R02 | 80331 | F | 1990 | Diabetes | 4 | 2 | 1 |
| R03 | 80331 | M | 1987 | Asthma | 4 | 2 | 1 |
| R04 | 80331 | M | 1975 | Hypertension | 4 | 2 | 1 |
| R05 | 80333 | F | 1987 | Migraine | 4 | 2 | 2 |
| R06 | 80333 | F | 1987 | Asthma | 4 | 2 | 2 |
| R07 | 80333 | M | 1962 | Diabetes | 4 | 2 | 1 |
| R08 | 80333 | M | 1990 | Asthma | 4 | 2 | 1 |
| R09 | 80335 | F | 1975 | Hypertension | 4 | 3 | 1 |
| R10 | 80335 | F | 1981 | Migraine | 4 | 3 | 2 |
| R11 | 80335 | M | 1962 | Asthma | 4 | 1 | 1 |
| R12 | 80335 | F | 1981 | Diabetes | 4 | 3 | 2 |
By ZIP code alone nobody is unique: every ZIP has four respondents. Add gender and one person stands out (R11, the only man in 80335). Add birth year and 8 of 12 respondents are unique. Anybody who knows that their 1962-born male neighbour in 80335 took part now knows his diagnosis. The data contains no names at all, and still most rows are effectively named. Now imagine full date of birth instead of birth year, plus occupation and marital status, as in the Larkfield survey. With five quasi-identifiers almost every record of a small survey is unique.
How to do it in Excel, step by step
- Make an inventory sheet. Insert a new sheet (Shift+F11) called "Inventory". In column A list every column header of the dataset. A quick way: select the header row, copy it, then Home → Paste → Paste Special → Transpose to turn the row into a column.
- Add an example value. In column B copy one real-looking value per column, from a synthetic or test record if possible. Seeing "m.okafor@example.com" makes the decision obvious in a way that the header "contact" does not.
- Restrict the Type column. Select C2:C13 and open Data → Data Validation. Choose Allow: List and type the source
Direct,Quasi,Sensitive,Other. Now every cell has a drop-down (open it with Alt+↓) and nobody can type "maybe". - Classify every row. Ask the question for each column: alone, does it point to a person? Then Direct. In combination? Then Quasi. Is it the secret? Then Sensitive. Otherwise Other. Write the reason in column D; you will need it when someone asks later.
- Count the groups. In C15 type
=COUNTIF(C2:C13,"Quasi*"). Add the same for the other types, for example=COUNTIF(C2:C13,"Direct*"), and a completeness check=COUNTA(C2:C13), which must equal the number of columns (12). - Make it visible. Select C2:C13 and use Home → Conditional Formatting → Highlight Cells Rules → Text that Contains with "Direct" to colour the columns that must be removed first. A second rule for "Quasi" marks the columns that the next steps will generalise.
- Test the combinations on the data itself. On the data sheet, add a helper column with
COUNTIFSover all quasi-identifiers, as in the extract above, and count the 1s. That single number tells you how many records are unique before you have changed anything. - Freeze the decision. Turn the inventory into a table with Ctrl+T, add the date and your name, and keep it with the dataset. When the data or the audience changes, you review the table, not your memory.

Pseudonymised is not anonymous
A common belief is that replacing names with codes makes data anonymous. Under the EU GDPR it does not. The regulation defines pseudonymisation (Article 4(5)) as processing that means data can no longer be attributed to a person without additional information, kept separately. Pseudonymised data is still personal data, because the key exists somewhere. Data counts as anonymous only when a person is no longer identifiable by means reasonably likely to be used (Recital 26), and quasi-identifiers are exactly such means.
In the United States, the HIPAA Privacy Rule for health data offers a "Safe Harbor" method that lists 18 types of identifiers to remove, among them names, small geographic units, all elements of dates except the year, and phone numbers. Notice that dates of birth and ZIP codes are on that list: the rule itself treats some quasi-identifiers like direct identifiers. Other countries have their own rules. The method in this course works the same everywhere: classify, then treat each group with the right technique, then measure what is left.
Common mistakes and how to spot them
- Calling internal IDs harmless. Customer, patient and employee numbers are direct identifiers for everyone who has access to the source system. Spot it: if a colleague could paste the value into a search box and find one person, it is Direct.
- Treating dates as one thing. A full date of birth is far more identifying than a birth year, and an admission date can be as revealing as a birth date. Spot it: list every date column separately and ask how precise it needs to be.
- Forgetting free text and file names. Comment fields, scanned file names and email subject lines often contain names. Spot it: filter text columns for capital letters followed by lowercase words, or simply read a sample of 50 rows.
- Counting with an exact match.
=COUNTIF(C2:C13,"Quasi")misses "Quasi-identifier" and "quasi " with a trailing space. Spot it: compare the sum of all type counts with=COUNTA(C2:C13). If they differ, a label is spelled differently. The wildcard version"Quasi*"is safer. - Removing the sensitive attribute. Deleting the diagnosis makes the file safe and useless. The goal is to keep what the analysis needs and protect it, so Sensitive columns usually stay.
- Classifying once and never again. A new column added next quarter, a smaller audience or a public dataset that can be linked changes the risk. Spot it: date the inventory and review it with every new release.
Quick reference: functions and shortcuts
| Function or shortcut | What it does here | Example |
|---|---|---|
COUNTIF(range, criteria) | Counts cells that match one condition, wildcards allowed | =COUNTIF(C2:C13,"Quasi*") returns 5 |
COUNTIFS(r1, c1, r2, c2, …) | Counts rows that match several conditions at once | =COUNTIFS($B$2:$B$13,B2,$C$2:$C$13,C2) |
Wildcard * and ? | * = any text, ? = one character | "Quasi*" also counts "Quasi-identifier" |
COUNTA(range) | Counts non-empty cells, for a completeness check | =COUNTA(C2:C13) should be 12 |
COUNTIF(F2:F13,1) | Counts the respondents whose combination is unique | Returns 8 for ZIP + gender + year |
| Data → Data Validation → List | Restricts the Type column to four allowed words | Source: Direct,Quasi,Sensitive,Other |
| Alt+↓ | Opens the drop-down list in a validated cell | Pick "Quasi" without typing |
| F4 | Toggles absolute references while editing a formula | B2:B13 → $B$2:$B$13 |
| Ctrl+Shift+L | Turns the filter arrows on or off | Filter the inventory by type |
| Home → Conditional Formatting → Highlight Cells Rules | Colours cells equal to a value | Highlight every count equal to 1 |
Real-world uses
- Research data sharing. A hospital or a city health office sends survey data to a university. The column inventory is the first page of the data sharing agreement and shows exactly which columns were removed, which were coarsened and which stayed.
- HR analytics. A pay-gap analysis needs salary (sensitive), gender, grade and department (quasi-identifiers). In a small department, the inventory shows immediately that department and grade together may point to one person, so results are reported only for larger groups.
- Test data for software projects. Developers need realistic data. The inventory tells you which columns to replace with synthetic values (all direct identifiers) and which to shuffle or coarsen before a copy of production data ends up on a test server.
- Customer analytics for marketing. A vendor builds a churn model from your customer table. You keep purchase history, remove names and emails, and generalise ZIP codes to regions because the model does not need street level precision.
- Answering an access or deletion request. When a person asks what data you hold about them, the inventory lists which columns in which file can identify them, so you can find and answer faster.
What you will build in the rest of this course
This first lab is free. The remaining 19 labs belong to the full course, a one-time purchase of $9.90, and they take the Larkfield survey from a column list all the way to a release you can defend.
Pseudonymisation: Lookup Keys, Salted IDs & Masking. You replace the names of ten customers with pseudonyms from a separate key table, build an illustrative salted ID and mask email addresses, and you see for yourself why whoever holds the key table can still re-identify everyone.
Generalisation: Age Bands & ZIP Prefixes. You coarsen age into 10-year bands and ZIP codes into 3-digit areas with formulas, then count how many of 20 records are still unique, the same check as in the extract above, but with the cure applied.
k-Anonymity: Equivalence Classes with COUNTIFS. You build the class size of every record with COUNTIFS, read the k of the release and test it against a target of k = 3.
Suppression of Small Classes & Information Loss. You remove the records in classes that are too small, measure how much data that costs and check whether the statistic the researchers care about is now biased.
l-Diversity: When Everyone in a Class Shares the Secret. A class of three identical-looking records is not safe if all three have the same diagnosis. You count distinct diagnoses per class and find the l of the release.
Re-identification Risk: 1/k, Average & Maximum Risk. You turn class sizes into risk figures, report the maximum and the average risk the way risk assessments do, and chart the risk by class.
Data Minimisation & Retention: Which Rows Must Go? You apply a retention schedule to twelve records with lookups and EDATE and flag every row that is due for deletion on the review date.
Summary
Every anonymisation project starts with a column inventory. Direct identifiers point to a person on their own and are removed or pseudonymised. Quasi-identifiers point to a person in combination and are generalised and measured with k-anonymity. Sensitive attributes are what must not be linked to anyone, and they usually stay. A simple COUNTIF with a wildcard counts the groups, and a COUNTIFS helper column on the data shows how many records are unique before you change anything.
Now scroll up to the lab and classify the email address, the ZIP code and the diagnosis, then count the quasi-identifiers in C15. It takes about ten minutes, the Coach checks each cell as you type, and you will look at every dataset you share a little differently afterwards.
Frequently asked questions
What is the difference between a direct identifier and a quasi-identifier?
A direct identifier such as a name, email address or patient number identifies a person on its own. A quasi-identifier such as date of birth, gender or ZIP code is shared by many people but can identify someone when combined with other quasi-identifiers.
Is pseudonymised data anonymous under the GDPR?
No. Under the GDPR pseudonymised data is still personal data, because the key that links the pseudonym to the person still exists. Data is anonymous only when a person is no longer identifiable by means reasonably likely to be used.
What counts as a sensitive attribute in a dataset?
A sensitive attribute is the information that must not be linked to a person, for example a diagnosis, a salary or a disciplinary record. It is usually kept for the analysis and protected by making the quasi-identifiers less precise.
How do I find unique records in Excel?
Add a helper column with COUNTIFS over all quasi-identifier columns, for example =COUNTIFS($B$2:$B$13,B2,$C$2:$C$13,C2,$D$2:$D$13,D2). A result of 1 means the record is unique, and =COUNTIF(H2:H13,1) counts how many there are.
Is removing names enough to anonymise a spreadsheet?
Usually not. The remaining quasi-identifiers such as birth date, gender and ZIP code often make individual rows unique, so a person can be recognised without a name. They need to be generalised or suppressed as well.
Why does COUNTIF use "Quasi*" with an asterisk?
The asterisk is a wildcard for any text, so the formula counts "Quasi", "Quasi-identifier" and similar spellings. An exact match would silently miss labels that a colleague typed differently.
Keep going: Data Privacy in Practice: Pseudonymisation, k-Anonymity & Re-identification Risk
This free lab is lesson 1 of 20. Unlock the other 19 hands-on labs, the final exam and your certificate for a one-time $9.90.
- Pseudonymisation: Lookup Keys, Salted IDs & Masking
- Generalisation: Age Bands & ZIP Prefixes
- k-Anonymity: Equivalence Classes with COUNTIFS
- Suppression of Small Classes & Information Loss
- l-Diversity: When Everyone in a Class Shares the Secret
- Re-identification Risk: 1/k, Average & Maximum Risk
- Data Minimisation & Retention: Which Rows Must Go?
- t-Closeness: How Far a Class Drifts from the Overall Mix
- Small Cells in Published Tables: Primary & Secondary Suppression
- Rounding Counts to Base 5 & the Additivity Problem
- Top-Coding Outliers: Capping Age & Income
- Noise Addition: Perturbing Values and Measuring the Bias
- Differential Privacy: The Laplace Mechanism for Counts
- Privacy Budget Ledger: Adding Up Epsilon across Queries
- Linkage Attack: Matching a Release against a Public List
- Date Shifting: Hiding Exact Dates but Keeping Intervals
- Measuring Utility: Average Class Size & Discernibility
- Choosing the Generalisation Level: Five Options Compared
- Final Project: Release Readiness Check for a Staff Survey