A method has been developed which allows the simultaneous refinement of X-ray powder diffraction data and one or more EXAFS spectra from the same sample using a single set of coordinates to describe the structure. The atomic positions are refined together with isotropic thermal factors, peak shape and amplitude parameters, and the EXAFS energy zeros for each absorption edge. The program determines the point symmetry and radial coordinates of each site occupied by an atom for which EXAFS data are available, allowing a full multiple scattering calculation to be performed for each site. Mixed or partial occupancy of sites is permitted. Where correlations between atoms can be calculated, as with copper for which Debye theory can be used, EXAFS mean-square displacements can be derived from the isotropic thermal factors' otherwise either the correlations or the EXAFS mean-square relative displacements must be introduced as separate variables. The method potentially allows us to accurately determine the position of oxygen and other light atoms in materials where the diffraction pattern is dominated by heavy atoms, and to determine the occupancy of sites where elements of similar scattering amplitude are involved. Results are particularly good where the EXAFS of several absorbing atoms are available.