Online self-study · Research Skills and Methods
Excel for quantitative analysis in pharmaceutical science
Everything from what a cell actually is to fitting a calibration line and defending it. Written for MSc Industrial Pharmaceutics students arriving from a range of first degrees — no prior confidence with Excel is assumed, and nothing here is graded.
Work through it with Excel open beside you. Each section ends with a self-check — answer before you read the explanation, because getting one wrong is the part that sticks. Your progress is remembered in this browser, so you can stop and come back.
When you reach the end, the workshop tasks put all of it to work on real pharmaceutical data. Bring a laptop to the live session.
Orientation: the Excel window
Workbooks, worksheets, cells and the three things you should always be able to see.
A workbook is the file. Inside it are worksheets — the tabs along the
bottom. Each worksheet is a grid of cells, addressed by column letter and row number:
B7 is column B, row 7. A rectangular block of cells is a range, written with
a colon: B7:B26 is twenty cells in one column.
Three parts of the window do most of the work, and most Excel confusion comes from ignoring them.
| A | B | C | |
|---|---|---|---|
| 6 | Vessel | Release (%) | Status |
| 7 | 1 | 92.4 | Pass |
| 8 | 2 | 94.1 | Pass |
| ⋮ | ⋮ | ⋮ | ⋮ |
| 20 | Mean | 93.3 |
- Name Box — top left. Tells you which cell is selected. You can also type an address into it and press Enter to jump there.
- Formula Bar — the wide box beside it. Shows the cell's underlying content. If
the cell shows
93.3but the Formula Bar shows=AVERAGE(B7:B18), the cell holds a formula. If the Formula Bar shows93.34166666, the cell holds a number that is merely being displayed rounded. - Status Bar — along the bottom. Select several numeric cells and it shows their count, sum and average instantly. It is the fastest sanity check in Excel, and it costs nothing.
Moving around without losing your place
| To do this | Windows | Mac | Menu route |
|---|---|---|---|
| Jump to the edge of a block of data | Ctrl + arrow | ⌘ + arrow | — |
| Select to the edge of a block | Ctrl+Shift+arrow | ⌘+Shift+arrow | Click and drag |
| Go back to the top left with panes frozen this lands below them, not on A1 | Ctrl+Home | Fn+Ctrl+← | Type A1 in the Name Box |
| Edit the selected cell in place | F2 | Ctrl+U | Click in the Formula Bar |
| Keep headings visible while scrolling | View > Freeze Panes | View > Freeze Panes | |
Clear Contents is not Delete. Clearing removes what is in a cell and leaves the cell where it is. Deleting removes the cell itself and shifts everything around it — which silently breaks every formula that pointed at the old positions. When you want to wipe a value, select it and press Delete, or use Home > Clear > Clear Contents. Reach for Delete Cells only when you genuinely intend the sheet to move.
Self-checkA cell displays 93.3. The Formula Bar shows
93.34166666666667. What is in the cell?
What Excel actually stores
Numbers, text, dates and logicals — and why "250 mg" breaks everything downstream.
Every cell holds one of four kinds of thing. Excel decides which as you type, and its decision is not always the one you wanted.
| Type | Looks like | Default alignment | Behaves how |
|---|---|---|---|
| Number | 548.2 | Right | Calculates, sorts numerically, counted by COUNT |
| Text | 548.2 mg | Left | Ignored by AVERAGE and SUM, counted only by COUNTA |
| Date / time | 01-Sep-2026 | Right | Stored as a serial number — dates can be subtracted |
| Logical | TRUE | Centre | Produced by tests such as =B7>85 |
Alignment is your free diagnostic. If a column of numbers is hugging the left edge, Excel is treating it as text. That happens constantly with data pasted out of an instrument report, a PDF or a supplier's certificate of analysis.
A column of twenty tablet weights, two of which arrived as 552.4 mg rather than
552.4. =AVERAGE(B7:B26) silently averages the eighteen it recognises and
returns a perfectly plausible number. Nothing goes red. Nothing warns you. The mean is simply wrong.
Catch it with =COUNT(B7:B26). COUNT counts numbers only, so if
the answer is 18 when you have 20 rows, you have found your fault. =COUNTA() counts
anything non-empty — comparing the two is a two-second audit.
Repairing text that should be numbers
- Remove the unit from the cell — units belong in the column heading, not in every value.
- If the whole column is affected, use Data > Text to Columns > Finish. It re-parses each cell and usually converts everything in one step.
- For stray spaces,
=VALUE(TRIM(B7))in a helper column, then paste the result back as values. A non-breaking space pasted from a web page is character 160, whichTRIMdoes not touch — use=VALUE(TRIM(SUBSTITUTE(B7,CHAR(160)," ")))instead. - Re-run
=COUNT()to confirm the repair actually worked.
The other direction: things that should stay text
Batch numbers, material codes and sample IDs are labels, not quantities. If a code like
0731 loses its leading zero, format the column as Text before pasting, or use a
custom number format such as 0000 to display the zero while keeping the underlying number
intact. Never let Excel turn RM-1042 into a date — it will try.
Self-checkYou have 24 rows of assay results. =COUNTA(B2:B25)
returns 24 and =COUNT(B2:B25) returns 21. What does that tell you?
Laying data out so it can be analysed
One row per observation, one column per variable, and no merged cells anywhere.
Most of the pain people have with Excel is not caused by Excel. It is caused by a layout designed to look like a printed table rather than to be analysed. The fix is the same one statisticians have been asking for since long before spreadsheets: tidy data.
Three rules that solve most problems
- One row per observation. One tablet, one vessel, one injection — one row.
- One column per variable, with a short heading that carries the unit:
Core weight (mg), notWeightwith "mg" typed into every cell. - No merged cells, no blank spacer rows, no totals in the middle. Put summaries beside or below the block, clearly separated.
Long or wide?
Two batches of dissolution data can be laid out either way, and the choice matters.
| Wide | Long |
|---|---|
One column per batch:Vessel | PT-2601 | PT-2602 |
One column identifying the batch:Vessel | Batch | Release (%) |
| Easier to read and to chart directly. Ideal when you have two or three groups and want them side by side — which is why the workshop workbook uses it. | Easier to filter, to summarise with COUNTIFS and AVERAGEIFS, and to hand to R, SPSS or Prism. Scales to any number of groups without new columns. |
If your data will end up in a statistics package, collect it long. If it is staying in Excel for a small comparison, wide is fine. Deciding before you start collecting saves an afternoon later.
Tables, freezing and filtering
- Freeze Panes (View > Freeze Panes) keeps your headings on screen. Click the cell below and to the right of what you want to keep visible, then freeze.
- Format as Table (Home > Format as Table, or Ctrl+T on both platforms — on a Mac ⌘+T is the dollar-sign toggle instead) gives the range a name, adds filter buttons, and — the real benefit — makes formulas grow automatically when you add a row. Give the table a sensible name in Table Design.
- Sort by selecting one cell inside the block and using Data > Sort. Never select a single column and sort it alone: you will detach it from its row and the damage is invisible.
Keep a raw data sheet that you never edit, and do all your working on a copy. When a result looks odd three weeks later — and it will — you need to be able to get back to what the instrument actually produced. This is not bureaucracy; it is the difference between a correctable mistake and an unexplainable one.
Self-checkWhy does putting "mg" into every cell of a weight column cause trouble?
Number formats: stored value vs display
Formatting changes what you see. ROUND changes what you have.
This is the single most useful idea in the whole unit. A cell has a value and a
format, and they are independent. A cell can store 0.13425 and display
0.13. Every later calculation still uses 0.13425.
Stored value against displayed value
Try setting the value to 0.0735 with a percentage format: Excel shows 7.4%,
because a percentage format multiplies the display by 100 and adds a sign. The cell still contains
0.0735. This is why =STDEV.S(...)/AVERAGE(...) formatted as a percentage gives
you %RSD directly — and why multiplying by 100 as well gives you a number a hundred times too big.
The formats worth knowing
| Format | Stored | Displayed | Use it for |
|---|---|---|---|
| Number, fixed decimals | 550.155 | 550.2 | Measurements — pick one number of decimals per column and keep it |
| Percentage | 0.0204 | 2.0% | %RSD, % of label claim held as a fraction |
| Scientific | 23000000000 | 2.30E+10 | Colony counts, very small or very large values |
Custom 0.000 | 0.4 | 0.400 | Forcing a consistent number of decimals for a table |
Custom 000000 | 731 | 000731 | Codes with leading zeros that must stay numeric |
| Text | RM-1042 | RM-1042 | Labels that Excel keeps trying to convert |
When you genuinely need to round the value
Use ROUND(number, digits) when a rounded number must feed into something else — a reported
result, a dose calculation, a value going onto a certificate. Keep the raw measurement in its own column
and round in a new one; never overwrite what you measured.
=ROUND(B7,1) rounds to 1 decimal place
=ROUND(B7,-1) rounds to the nearest 10
=ROUNDUP(B7,0) always away from zero — for pack quantities
=ROUNDDOWN(B7,0) always toward zero
Excel does not know how precise your measurement is. An analytical balance reading to 0.1 mg does not entitle you to report an assay to six figures. Decide the number of significant figures from the method, apply it at the point of reporting, and carry full precision through every intermediate step in between. Rounding early and repeatedly is how small errors become visible ones.
Self-checkA colleague makes a column tidier by retyping every
0.13425 as 0.13. What have they actually done?
Formulae and what errors mean
The anatomy of a formula, the order Excel works in, and how to read a failure.
A formula always starts with =. Everything after it is an expression built from values,
cell references, operators and functions. Excel evaluates it and puts the answer in the cell, keeping the
formula itself in the Formula Bar.
=(B7-$C$5)/$C$5
│ │ │
│ │ └── an absolute reference — locked, will not move when copied
│ └────── a relative reference — moves when copied
└────────── every formula begins with an equals sign
Operators, and the order they run in
| Order | Operator | Does |
|---|---|---|
| 1 | ( ) | Brackets first — always |
| 2 | ^ | Power |
| 3 | * / | Multiply, divide — left to right |
| 4 | + - | Add, subtract — left to right |
| 5 | & | Join text |
| 6 | = <> < > <= >= | Compare — returns TRUE or FALSE |
=B7-C5/C5 divides first, so it returns B7 − 1.
=(B7-C5)/C5 is what you meant. When a result is wildly wrong but not an error, a missing
pair of brackets is the first thing to check.
Reading an error instead of panicking at it
Excel's error values are diagnostic, not decorative. Each one names a different kind of fault.
Error decoder — click one
Finding the cause
- Formulas > Trace Precedents draws arrows to the cells a formula depends on. Trace Dependents does the reverse. Remove Arrows clears them.
- Formulas > Evaluate Formula steps through a long formula one operation at a time and shows you the intermediate result. It is the best debugging tool in Excel and almost nobody uses it.
- Formulas > Show Formulas (Ctrl+` on Windows and Mac alike) displays every formula instead of its result — the fastest way to spot one cell that was overtyped with a constant.
=IFERROR(A2/B2,"") hides the error. It does not fix the cause,
and it will hide the next error too — including one you needed to see. Wrap a formula in
IFERROR only once you know why the error occurs and have decided a blank is the right answer. During
analysis, leave errors visible.
Self-checkA lookup that worked yesterday now returns
#REF! in every row. What most likely happened?
Relative, absolute and mixed referencing
What the dollar signs do, and why one missing pair ruins a column.
When you copy a formula, Excel adjusts its references by however far the formula moved. That is usually
exactly what you want — copy =B7*C7 down a row and it becomes =B8*C8, which is
the point. It stops being what you want the moment a formula needs to keep pointing at one cell:
a target weight, a dilution factor, a VAT rate, a response factor.
| Written | Called | When copied |
|---|---|---|
C5 | Relative | Column and row both shift |
$C$5 | Absolute | Neither shifts — always cell C5 |
$C5 | Mixed | Column C is fixed; the row shifts |
C$5 | Mixed | Row 5 is fixed; the column shifts |
To add or remove the dollar signs, click inside the reference in the Formula Bar and press F4 on Windows or ⌘+T on a Mac. Each press cycles through the four combinations. You can also just type them.
Reference explorer — lock parts and watch the fill
The formula =B7*C3 sits in cell
D7. Lock whichever parts you like, then read what the formula becomes as it is filled
down and across.
Three patterns worth recognising
Nothing locked — fine for row-by-row arithmetic where every input sits on the same row as its answer.
Second reference fully locked ($C$3) — one constant applied to a whole
column. This is the commonest pattern in lab spreadsheets and the commonest one to get wrong.
Column locked on one, row locked on the other
(=$B7*C$3) — fills a two-dimensional grid from a single formula. Concentration against
dilution factor, cost against batch size, dose against body weight.
Named ranges — the readable alternative
Select a cell, type a name into the Name Box, press Enter. Now =B7/Target_weight works
anywhere on the sheet and is absolute automatically. Formulas > Name Manager lets you edit them.
Names make a spreadsheet far easier for someone else to check, which matters when that someone else is
your supervisor or an examiner. Keep them short, avoid spaces, and name the thing rather than its
location: Dilution_factor, not Cell_C5.
Self-checkCell C9 contains =B9-$E$3. You fill it down
to C10. What does C10 contain?
Self-checkYou want one formula in H11 that fills across columns H to K and down rows 11 to 14, dividing the stock concentration in column G by the dilution factor in row 9. What should it be?
Core functions and logical tests
A small toolkit, used well, covers almost everything you will need.
A function takes arguments in brackets, separated by commas, and returns one answer. Start typing
=AV and Excel offers the matching functions; press Tab to accept one and it shows
you the arguments it expects as you go.
Summarising a range
=SUM(B7:B26) add them up
=AVERAGE(B7:B18) arithmetic mean — ignores text and blanks
=MEDIAN(B7:B18) middle value — far less affected by one outlier
=MIN(B7:B18) =MAX(B7:B18)
=COUNT(B7:B26) how many are numbers
=COUNTA(B7:B26) how many are not empty
=COUNTBLANK(B7:B26) how many are empty
Counting and averaging with conditions
These are the workhorses of batch data. A comparison criterion goes in quotation marks; a plain value does not need them.
=COUNTIF(B7:B18,"<85") vessels below 85%
=COUNTIFS(B7:B16,">=85",B7:B16,"<=115") units inside the window
=SUMIF(A2:A99,"Paracetamol",C2:C99) total for one material
=AVERAGEIFS(C2:C99,A2:A99,"PT-2601",B2:B99,"45 min")
To compare against a limit held in a cell rather than typed into the formula — which is what
Section 13 argues you should always do — join the operator to the reference with &:
=COUNTIF(B7:B18,"<"&$E$3) below the limit in E3
=COUNTIFS(B7:B16,">="&$E$3,B7:B16,"<="&$E$4) inside a window defined by two cells
Note the argument order differs between them: COUNTIFS takes range/criterion pairs, while
SUMIFS and AVERAGEIFS put the range being summed or averaged
first. SUMIF and AVERAGEIF, confusingly, put it last. Let Excel's
argument tooltip guide you rather than trusting memory.
Making a spreadsheet decide something
=IF(B7>=85,"Pass","Fail")
=IF(AND(B7>=85,B7<=115),"Within","Outside")
=IF(OR(B7<85,B7>115),"Investigate","")
=IFS(B7<85,"Low",B7>115,"High",TRUE,"Within")
IF takes a test, an answer when it is true, and an answer when it is false.
AND requires every condition; OR requires at least one. IFS works
through conditions in order and stops at the first true one — the final TRUE acts as
"otherwise". It is much easier to read than four nested IFs, and much easier to correct.
A pass/fail column is a specification written down where anyone can check it. Six months later, "why did we release that batch?" has an answer you can point at, rather than a recollection. Write the limits into cells and reference them, so changing a specification means editing one cell rather than hunting through forty formulas.
Function finder
| Function | What it gives you |
|---|
Self-checkYou need the number of results between 85 and 115
inclusive, from the range B7:B16. Which is right?
Lookup: XLOOKUP and friends
Finding the record that matches, and banding a number into a category.
Lookups answer two different questions, and knowing which one you are asking prevents most lookup disasters.
- Exact match — "what is the supplier for material RM-1042?"
- Approximate match — "a Carr's index of 15.9% falls into which flow band?"
XLOOKUP
=XLOOKUP(lookup_value, lookup_array, return_array,
[if_not_found], [match_mode], [search_mode])
Only the first three are required. The rest are where the real value is.
| Argument | Set it to | Because |
|---|---|---|
if_not_found | "Not approved", "", anything useful | Turns a bare #N/A into a message a reader can act on |
match_mode | 0 exact (default)-1 exact or next smaller1 exact or next larger | -1 is how you band a number against a table of lower limits |
search_mode | 1 first to last (default)-1 last to first | -1 finds the most recent entry in a log that grows downwards |
Exact match — pulling a record across
=XLOOKUP(A19,$A$7:$A$14,$B$7:$B$14,"Not approved")
Lock the lookup and return ranges with $ so the formula can be filled down without the
reference table sliding out from under it. That single omission is the most common lookup fault there is.
Approximate match — banding a value
Build a table of lower limits, sorted ascending, beside the labels. Then
match_mode = -1 finds the largest limit that does not exceed your value.
| Carr's index, lower limit (%) | Flow character |
|---|---|
| 0 | Excellent |
| 11 | Good |
| 16 | Fair |
| 21 | Passable |
| 26 | Poor |
| 32 | Very poor |
| 38 | Very, very poor |
=XLOOKUP(J18,$G$8:$G$14,$H$8:$H$14,,-1)
A blend with a Carr's index of 15.86% returns Good, not Fair — because
15.86 has not reached 16. Round it to one decimal place first and you would get 15.9, still Good. Round it
to a whole number and you get 16, and the wrong answer. This is the stored-value-versus-display idea from
Section 4 doing real damage.
XLOOKUP needs Microsoft 365 or Excel 2021. If you see #NAME?, your
Excel is older. =INDEX($B$7:$B$14,MATCH(A19,$A$7:$A$14,0)) does the same job in every
version, and unlike VLOOKUP it does not care whether the return column sits left or right of the lookup
column. Avoid VLOOKUP in new work: it counts columns by position, so inserting a column silently breaks
it.
When a lookup insists there is no match
- Trailing spaces.
"RM-1042 "is not"RM-1042". Wrap the lookup value inTRIM(), or clean the source column. - Number stored as text. A code that is text in one table and numeric in the other will never match. Check the alignment in both.
- A binary search on unsorted data.
search_mode2 and −2 assume the lookup array is sorted, and return nonsense rather than an error if it is not. The default search mode scans linearly, somatch_mode −1does not itself require sorting — but keep a band table sorted anyway, because a human has to read it. - Hidden characters. Data from a web page often carries non-breaking spaces —
character 160, which neither
TRIMnorCLEANremoves.=TRIM(SUBSTITUTE(A2,CHAR(160)," "))does.
Self-checkYour formulation sheet contains a material code that is
not in the approved list. You want the cell to say "Not approved" rather than #N/A.
Which argument does that?
Descriptive statistics
A mean on its own is a half-finished sentence.
A dissolution test gives you twelve results, not one. Two batches can share a mean of 93% and behave completely differently: one tightly clustered, the other with three vessels failing and three over-performing. The mean hides exactly the thing a regulator, a supervisor and a patient care about.
The core set
| Quantity | Excel | What it tells you |
|---|---|---|
| n | =COUNT(B7:B18) | How many results — always report it |
| Mean | =AVERAGE(B7:B18) | Centre of the data; pulled about by outliers |
| Median | =MEDIAN(B7:B18) | Middle value; barely moved by one rogue result. A mean well away from the median is a warning |
| Standard deviation | =STDEV.S(B7:B18) | Typical distance of a result from the mean, in the original units |
| Variance | =VAR.S(B7:B18) | SD squared. Used in tests; not for reporting, since the units are squared |
| Range | =MAX(...)-MIN(...) | Crude but instantly interpretable |
| %RSD | =STDEV.S(...)/AVERAGE(...) | SD as a proportion of the mean — the standard measure of precision in pharmaceutical analysis |
| SEM | =STDEV.S(...)/SQRT(COUNT(...)) | How precisely you know the mean, not how spread the data are |
| 95% CI half-width | =CONFIDENCE.T(0.05,STDEV.S(...),COUNT(...)) | Add and subtract from the mean to get the interval |
| Quartiles | =QUARTILE.INC(B7:B18,1) | With the median, describes a skewed distribution better than mean ± SD |
STDEV.S treats your numbers as a sample and divides by n − 1.
STDEV.P treats them as the entire population and divides by n.
Twelve vessels are a sample of the batch. Ten units are a sample of the
compression run. In pharmaceutical work the answer is essentially always STDEV.S. With
n = 12 the difference is about 4% of the SD — small enough never to look wrong, consistent enough to
be wrong every single time. The same split applies to VAR.S / VAR.P.
SD or SEM? They answer different questions
SD describes how much the individual results vary. SEM describes how precisely you have located the mean, and it shrinks as you collect more data — SEM = SD ÷ √n. Neither is more correct; they are answers to different questions.
- Describing how variable a batch is → SD.
- Describing how confident you are about a mean → SEM or, better, a confidence interval.
- Plotting error bars → whichever you like, but state which in the caption. An unlabelled error bar is meaningless, and SEM bars are roughly a third the length of SD bars at n = 12, which makes an unlabelled chart quietly misleading.
Confidence intervals
A 95% confidence interval is the mean plus and minus a margin. Use CONFIDENCE.T, which uses
the t distribution — correct when you estimated the SD from a small sample, which you always
have. CONFIDENCE.NORM assumes you already know the population SD, which you never do.
=AVERAGE(B7:B18) - CONFIDENCE.T(0.05,STDEV.S(B7:B18),COUNT(B7:B18)) lower
=AVERAGE(B7:B18) + CONFIDENCE.T(0.05,STDEV.S(B7:B18),COUNT(B7:B18)) upper
Report it as 93.3 ± 1.2% (mean ± 95% CI, n = 12). Loosely: if you repeated the whole study many times, about 95% of the intervals you calculated that way would contain the true mean.
Summary calculator — paste your own numbers
Check your own workbook against this. If the two disagree, one of you has used STDEV.P.
A result far from the others is information, not an inconvenience. Investigate it — a transcription slip, a misfilled die, an air bubble in a dissolution vessel — and exclude it only with a documented reason recorded at the time. Deleting a number because it spoils the mean is falsification, and a reviewer who sees n = 11 where the method says 12 will ask why.
Self-checkTwelve dissolution results have SD = 1.905%. What is the standard error of the mean?
Comparing two sets of results
The t-test, the p-value, and the sentence people always get wrong.
Two batches give mean assays of 99.9% and 97.1%. Is that a real difference, or the sort of wobble you would expect from ten determinations of identical material? A t-test answers exactly that question and nothing beyond it.
The logic, in four lines
- Assume there is no real difference between the two batch means. That assumption is the null hypothesis.
- Work out how big a difference you could plausibly see anyway, given the spread and the sample size.
- Compare your actual difference with that.
- The p-value is the probability of seeing a difference at least this large if the null hypothesis were true.
Running it in Excel
=T.TEST(array1, array2, tails, type)
| Argument | Value | Use when |
|---|---|---|
tails | 2 | Almost always. You care about a difference in either direction |
| 1 | Only if you decided before collecting data that one direction is the only one of interest | |
type | 1 — paired | The same units measured twice: before and after storage, two methods on one sample |
| 2 — two-sample, equal variances | Independent groups with similar spread | |
| 3 — two-sample, unequal variances | Independent groups with clearly different spread (Welch's test) |
Choosing between type 2 and type 3
=F.TEST(array1,array2) compares the two variances and returns its own p-value. A large
value means the spreads are similar; a small one means they are not.
Many textbooks tell you to use that result to pick between type 2 and type 3, and you will see it done
that way constantly. It is worth knowing that statisticians increasingly advise against it: the F-test is
very sensitive to non-normality, and choosing your test on the basis of the data distorts the error rate
of the test that follows. The simpler modern advice is to use Welch's test (type 3) by
default — it costs almost nothing when the variances really are equal, and protects you when
they are not. Use F.TEST to describe the spreads, not to decide for you.
- It is not the probability that the null hypothesis is true.
- It is not the probability that your result happened by chance.
- It says nothing about how big the difference is.
- p = 0.06 does not mean "no difference". p = 0.049 does not mean "proved". 0.05 is a convention, not a law of nature.
Significant is not the same as important
In the workshop you will compare two batches whose means differ by 2.8% of label claim. With n = 10 and tight data, p comes out at around two in a million — overwhelming evidence that the difference is real. Both batches sit comfortably inside a 95–105% specification.
So the difference is real, and it does not justify rejecting anything. It might well justify a look at the process: a real, reproducible drift is worth understanding before it becomes large enough to matter. The statistics tell you the difference exists; pharmaceutical judgement tells you what to do about it.
Collect enough data and almost any difference becomes statistically significant. That is why you report the size of the difference and a confidence interval for it, not a p-value alone.
Assumptions, and what to do about more than two groups
A t-test assumes the observations are independent, and that the data are roughly normally distributed — or that the sample is large enough for the means to behave normally. With small samples of analytical data, both are usually reasonable. Obvious skew, or a distribution with a hard floor at zero, is a reason to think again rather than to press on.
For three or more groups, do not run a t-test on every pair. Each test carries its own chance of a false positive, and three pairs give you roughly a one-in-seven chance of at least one arising by luck alone. One-way ANOVA tests them together; Excel offers it through the Analysis ToolPak (File > Options > Add-ins on Windows; Tools > Excel Add-ins on Mac). Check it is installed on your own machine before you rely on it. Beyond that, a dedicated statistics package is the right tool, and your supervisor will expect one.
Self-checkA two-sample t-test returns p = 0.002. Which statement is correct?
Regression and calibration
Turning a peak area into a concentration, and knowing when not to.
A calibration line is the bridge between what an instrument measures and what you want to report. Fit it carelessly and every downstream number inherits the fault — the assay, the release decision, the conclusion in your dissertation.
Fitting the line
Excel's regression functions take the y range first, then the x range. Getting them the
wrong way round produces a perfectly plausible number that is completely wrong, so check it every time.
RSQ is the exception — it gives the same answer either way, which is precisely why it will
never warn you that the others are reversed.
=SLOPE(B7:B12,A7:A12) gradient m — the method's sensitivity
=INTERCEPT(B7:B12,A7:A12) c — response predicted at zero concentration
=RSQ(B7:B12,A7:A12) R² — closeness of the points to the line
=STEYX(B7:B12,A7:A12) residual standard error — typical vertical miss
Together these give y = mx + c. Build the equation as a live formula rather than typing the
numbers in, so it updates if a standard is corrected:
="y = "&TEXT(F7,"0.0000")&"x + "&TEXT(F8,"0.0000")
Back-calculating a sample
Rearranging y = mx + c gives x = (y − c) ÷ m. Do it in visible stages rather
than one heroic formula, so each step can be checked:
| Step | Formula | Worked example |
|---|---|---|
| Concentration injected (µg/mL) | =(area-$F$8)/$F$7 | 49.61 |
| × dilution factor (5 mL → 100 mL) | =previous*20 | 992.14 |
| × volume, converted to mg (500 mL) | =previous*500/1000 | 496.07 mg |
| ÷ label claim (500 mg) | =previous/500 | 99.2% |
Is the line good enough?
- R² tells you how much of the variation in y the line accounts for. For a routine calibration you would expect 0.999 or better. It is necessary, not sufficient.
- STEYX tells you, in real units, how far a typical point sits from the line. Unlike R² it does not improve just because you widened the concentration range.
- The residuals. Calculate observed − fitted for each standard and plot them against concentration. Randomly scattered around zero is what you want. A curve, a funnel, or one point far out tells you something R² cannot: that a straight line is the wrong model, that variance grows with concentration, or that one standard was misprepared.
- The intercept. A large one relative to your lowest standard suggests baseline drift, a co-eluting peak, or a blank that is not blank.
R² = 0.9999 says the points lie close to a line. It does not say the method is accurate, that it is specific for your analyte, that the line passes near the origin, or that a reading outside the calibrated range means anything at all. Standards from 2 to 100 µg/mL license you to report results from 2 to 100 µg/mL. A sample reading 180 must be diluted and re-injected, never extrapolated.
Limits of detection and quantitation
The ICH Q2 approach based on the calibration line uses the residual standard deviation as an estimate of the noise:
LOD = 3.3 × STEYX ÷ SLOPE
LOQ = 10 × STEYX ÷ SLOPE
Other approaches use the standard deviation of the intercept, or replicate measurements of a blank, and will give you different numbers. Whichever you use, say which — an LOD quoted without its method is not a result, it is a rumour.
Two decisions people make without noticing
Forcing the line through zero. Excel's trendline offers "Set intercept = 0". It is almost always the wrong choice. A real method has a small non-zero intercept, and forcing it away does not remove the bias — it redistributes it into the slope, making every result slightly wrong in a way that is hardest to detect at low concentrations.
Ordinary least squares over a wide range. Standard regression assumes the scatter is the same at every concentration. Over two or three orders of magnitude it usually is not — absolute variability grows with concentration, so the top standards dominate the fit and the bottom of the curve fits poorly. Narrowing the range is the simple answer; weighted regression (1/x or 1/x²) is the proper one, and is worth knowing exists when your project needs it.
LINEST — when you need the uncertainties too
=LINEST(B7:B12,A7:A12,TRUE,TRUE) returns a block of statistics: slope and intercept on
the first row, their standard errors on the second, R² and STEYX on the third. In Microsoft 365 it
spills into the cells below and right on its own. In older versions you select a 2-column by 5-row
block, type the formula and press Ctrl+Shift+Enter.
The standard error of the slope is what lets you put a confidence interval on a result rather than quoting a bare number — which is the difference between an undergraduate report and a master's one.
Self-checkYour calibration runs from 2 to 100 µg/mL with R² = 0.9998. A sample gives a peak area that back-calculates to 168 µg/mL. What should you do?
Charts: building them and judging them
A chart is an argument. Excel's default is rarely the argument you meant to make.
Dr Parsons' session looks at what makes a data graphic effective or misleading. This section is the mechanics: how to build the chart you have decided on, and how to judge your own before anyone else does.
Scatter or line? The distinction that matters most
This is the mistake that appears most often in dissertations, and it is invisible until someone points it out.
| XY Scatter | Line | |
|---|---|---|
| x axis | A true numeric scale | Evenly spaced categories |
| Use for | Calibration curves, dissolution against time, any two measured quantities | Named categories in a meaningful order — weekday, stability timepoint labelled as a visit |
| The trap | — | Times of 0, 5, 10, 15, 20, 30, 45 and 60 minutes get plotted at equal spacing, so the shape of the curve is wrong |
If your x values are numbers with real distances between them, use a scatter chart. Excel's Line chart treats them as labels no matter how numeric they look — with one exception: genuine Excel dates get a date-scaled axis, which is spaced proportionally. Elapsed minutes and concentrations are not dates, so they do not get that treatment.
Which chart? Answer two questions
Building an XY scatter properly
- Select the x column and the y column together. Insert > Chart > Scatter, markers only.
- Add a second series for a fitted line: right-click the chart > Select Data > Add, with the same x values and your calculated fitted-y column. Format it as a line with no markers.
- Chart Design > Add Chart Element > Axis Titles. Put the unit in brackets:
Concentration (µg/mL). - Give the chart a title that says what the reader is looking at, not "Chart 1".
- Delete the legend if there is only one series. It is telling the reader nothing they cannot see.
Excel's built-in trendline will draw the fit and display the equation and R²
in a text box. It is quick, and fine for a first look. A calculated fitted column
—=slope*x+intercept in real cells — is better for anything you will submit: every plotted
value can be traced to a formula, the equation on the chart comes from cells rather than a label, and
an examiner can audit it. Use the trendline to explore; use calculated values to report.
Error bars that mean something
- Click the series, then Chart Design > Add Chart Element > Error Bars > More Options.
- Choose Custom > Specify Value, and point both the positive and negative boxes at your SD column. Never use the "Standard Deviation" preset — it calculates one value from the plotted series rather than using your per-point SDs.
- Say in the caption what the bars are: mean ± 1 SD, n = 12. SD, SEM and 95% CI bars look identical and can differ by more than threefold: at n = 12 with an SD of 1.91, the SEM is 0.55 and the 95% CI half-width is 1.21.
Judging your own chart
Before it leaves your screen
- Both axes titled, with units in brackets.
- A title that states what is shown, including n where relevant.
- No legend on a single-series chart; series labelled directly where you can.
- A value axis starting at zero wherever the reader compares lengths — bars and columns always. On a scatter or line chart, position is the encoding, so a range chosen to suit the data is legitimate; just make the truncation obvious rather than accidental.
- Error bars defined in the caption.
- Still readable in greyscale, and still readable if the reader cannot distinguish red from green. Vary marker shape as well as colour.
- No 3-D, no drop shadows, no gradient fills, no decorative backgrounds.
- Gridlines faint or absent; they should never compete with the data.
- Enough contrast and a font size that survives being shrunk into a report.
A truncated y axis. Starting at 90% instead of 0 turns a 3% difference into a cliff. Sometimes truncation is right — a dissolution profile between 80 and 100% — but it must be visible and defensible, never the default Excel happened to pick.
A pie chart with more than three slices. People compare lengths far better than angles. Six defect types belong in a bar chart, sorted by size.
A second y axis. Two series on different scales can be made to cross wherever you choose simply by adjusting the axes. If you must use one, label both axes unmistakably — and consider two stacked charts sharing an x axis instead.
Self-checkYou are plotting cumulative release at 0, 5, 10, 15, 20, 30, 45 and 60 minutes. Which chart type?
Working so someone else can check you
The habits that separate a spreadsheet from a liability.
At some point your supervisor, an examiner or a colleague will open your workbook and try to follow what you did. Whether that takes them five minutes or leaves them unable to reproduce your result is decided by choices you make now, not later.
Six habits
- Never type a number into a formula. Put the dilution factor, the label claim, the specification limits into their own labelled cells and reference them. When a value changes you edit one cell, not forty formulas — and a reader can see what your assumptions were.
- Keep raw data untouched. One sheet, exactly as the instrument produced it, never edited. All working happens elsewhere.
- Label everything. Every block gets a heading, every column a unit, every sheet a
name that says what it holds.
Sheet1andCopy of Copy of dataare how results get lost. - Write down what you did. A small notes block — where the data came from, which standard, what you excluded and why, what date. Two minutes now, an hour saved in six months.
- Version by date, not by adjective.
2026-09-22 dissolution PT-2601 v2.xlsxsorts chronologically and never becomesfinal_FINAL_use-this-one.xlsx. - Protect what should not be typed over. Review > Protect Sheet, having first unlocked the cells that are meant to be edited. It is a guard rail, not security.
Checking before you trust
- COUNT everything. If you should have 12 results, confirm you have 12 numbers.
- Estimate the answer first. If the mean of numbers around 93 comes out as 9.3 or 930, you have a decimal or a range problem. This one habit catches more errors than any other.
- Recalculate one row by hand. One. It validates the whole column.
- Show Formulas (Ctrl+` on both platforms) and scan the column. A cell someone overtyped with a constant stands out immediately — and a hard-coded value hiding in a column of formulas is the most expensive bug in spreadsheets.
- Check the extremes. Sort by your result column and look at the top and bottom few. Impossible values surface instantly.
Moving results into a report
- Charts into Word: copy the chart, then Paste Special > Picture. A pasted picture cannot silently change when you edit the workbook. Add alternative text and a numbered caption.
- Tables into Word: paste the values, not a live link, and round at the point of reporting rather than in the source data.
- Always state: n, what any error bars represent, which statistical test you used and its p-value, and what software produced the analysis. Every one of those is a question a marker will ask if you leave it out.
Excel is the right tool for organising data, routine calculation, calibration and quick exploratory charts. For anything with several factors, repeated measures, or figures you want to be proud of, you will move to a dedicated package — and every habit in this section transfers directly. Tidy data, documented steps and checkable working are the point; the software is incidental.
Self-checkWhy is typing the dilution factor 20 directly into fifteen formulas a bad idea?