Based on the rather vague description you've given us (...a group of people standing clumped but at different distances, quite close to me...) it seems likely your subjects were too close to you to allow them all to fit within the depth of field of the focal length and aperture of your lens. For us to be certain, we need to know the camera's format (sensor size), focal length, aperture value, and subject distance. So far you've only given us f/18 for the aperture, which means that the effects of diffraction could be part of the issue as well.
You can only focus the lens at a single distance. Everything in front of or behind that distance will be blurry to one degree or another. The greater the distance (actually the greater the ratio of the two distances being compared), the greater the blur will be.
If more than one AF point is active and showing as in focus, that only means that each of them is indicating proper focus of a portion of the scene that is the same distance from the camera as the other portions of the scene that are being indicated as in focus.
For the same focal length and aperture, the closer the focus distance is, the more shallow the depth of field will be. Get close enough and use a wide enough aperture and you can't even get both eyes of a single person sitting at a 45 degree angle to the camera in focus at the same time!
What we call Depth of Field is the distance in front of or behind the point of focus that still appears acceptably sharp to our eyes when we view an image. DoF is dependent upon two main things: magnification and aperture. The focal length of the lens, the focus distance, and the size and distance of the image when we view the image affect magnification. You can take the same captured image and view it from a specific distance at a small size, say 8x10, and a much larger size, say 32x40, and things that look sharp in the smaller size will appear blurry in the larger one.
In the end, DoF is just an illusion, albeit a very convincing one.