Powder diffraction is one of the most widely used analytical techniques for characterizing solid state materials. It can be used for phase or polymorph identification, quantitative analysis, cell parameter determination or even full crystal structure analysis using the powerful Rietveld refinement method.As with much of modern crystallography, the software used for Rietveld refinement is frequently treated as a "black box" that produces often-poorly-understood outputs. This paper shows how it is possible for students to perform a full Rietveld refinement against experimental powder diffraction data from scratch using a simple spreadsheet like Excel. It starts by reviewing the basic ideas of leastsquares fitting a straight line, develops these into fitting simple functions to peaks in simulated experimental data, then combines these ideas with crystallographic equations to enable Rietveld refinement of the structure of an inorganic material (rutile, TiO2). At each stage students can selflearn different fundamental aspects and pitfalls of data analysis that are widely re-applicable. The ideas can be taught as an online learning exercise, or could be incorporated in a laboratory class where students collect and analyze their own experimental data.