Different types of particle and/or cell patterning in acoustic cavities produced by the radiation force of ultrasonic standing waves have been observed. However, most explanations of this phenomenon are constrained to particles much smaller than the wavelength (i.e., the so-called Rayleigh regime). Here, we present a theoretical model for acoustic trapping and patterning of particles/cells in a rectangular cavity beyond the Rayleigh regime. A simple closed-form expression of the radiation-force potential for particles of virtually any size immersed in a fluid is obtained. Particles with a size comparable to one wavelength (Mie particles) can be trapped in acoustic potential wells, whose stability is quantified by the trap stiffness. Our findings reveal that an acoustic trap can occur at a pressure node, antinode, and midpoint (i.e., a point midway between two nodes). These locations depend on the acoustic parameters of the particle and surrounding fluid (density, longitudinal, and shear speed of sound) and the ratio of particle size to wavelength. We also investigate the effects of the secondary radiation forces on trapping stability. We determine the possible acoustic patterns formed with polystyrene particles and osmotically swollen red blood cells (SRBCs). The conditions that may lead to one particle/cell per acoustic well patterning are discussed. A set of patterning experiments is performed with an acoustofluidic rectangular device, operating at 6.5-MHz frequency, using polystyrene particles with diameters of 10μm (Rayleigh particles) and 75μm (Mie particles) immersed in distilled water. The obtained experimental results are consistent with our theoretical predictions. The present study can help in designing acoustofluidic devices with the ability to spatially arrange larger, or more closely spaced particles, cells, and other micro-organisms.