Briefly, the full width of the photoelectron spectrum (from the highest kinetic energy/lowest binding energy point to the low kinetic energy cutoff) is measured and subtracted from the photon energy of the exciting radiation, and the difference is the work function.
To determine the work function, the full breadth of the photoelectron spectrum, encompassing the entire range from the lowest kinetic energy to the cutoff at higher energies, is subtracted from the photon energy of the stimulating radiation. The outcome is this difference.