The objective of crystal structure prediction (CSP) is to predict computationally the thermodynamically stable crystal structure of a compound from its stoichiometry or its molecular diagram. Crystal similarity indices measure the degree of similarity between two crystal structures, and are essential in CSP because they are used to identify duplicates. In addition, powder-based indices, which are based on comparing X-ray diffraction patterns, also allow the use of experimental X-ray powder diffraction data to inform the CSP search. Powder-assisted CSP presents two unique difficulties: i) the experimental and computational structures are not entirely comparable because the former is subject to thermal expansion from lattice vibrations, and ii) experimental patterns present features (noise, background contribution, varying peak shapes, etc.) that are not easily predictable computationally. In this work, we present a powder-based similarity index (GPWDF) based on a modification of de Gelder et al.'s index using cross-correlation functions that can be calculated analytically. Based on GPWDF, we also propose a variable-cell similarity index (VC-GPWDF) that assigns a high similarity score to structures that differ only by a lattice deformation and takes advantage of the analytical derivatives of GPWDF with respect to the lattice parameters. VC-GPWDF can be used to identify similarity between: two computational structures generated using different methods, a computational and a experimental structure, and two experimental structures measured under different conditions (e.g. different temperature and pressure). In addition, VC-GPWDF can also be used to compare crystal structures with experimental patterns in combination with an automatic pre-processing step. The proposed similarity indices are simple, efficient, and fully automatic. They require no indexing of the experimental pattern or a guess of the space group, account for deformations caused by varying experimental conditions, give meaningful results even when the experimental pattern is of very poor quality, and have a cost does not increase with the flexibility of the molecular motif.