A cofferdam is basically a void space which separates tanks containing different substances. Should one tank leak, it will not contaminate the other. eg fresh water tanks are separated from oil tanks and sewage holding tanks by a cofferdam. Ship construction usually dictates thwartship tanks, so, for example, a cofferdam would be incorporated between cargo tanks and accommodation spaces.
They may, indeed, extend from keelson to weather deck, depending on the application. You can see this quite clearly in Kemp and Young's sketch of a tanker on p 109 of the referenced publication. In some applications, a pump room or water ballast space can substitute for a cofferdam, as shown in the sketch on p 110 of the same book. There is a bilge suction in each void space.
The longitudinal cofferdam in a tanker or bulker is usually called the pipe tunnel, or duct keel, in which runs ballast, cargo and bilge piping, with associated valves. Not a lot of fun cramped down there in a seaway repairing and overhauling remote valve actuators!
See "Ship Construction", 2nd Edition, D.J. Eyres, published by Heinemann, London (a bit technical for the layman)
Kandy's, "Ship Construction, Sketches and Notes" Kemp and Young, published by Stanford Maritime, London. (excellent sketches in here)
Discourage incest, ban country "music".