Given Polish spaces X and Y and a Borel set S ⊆ X × Y with countable sections, we describe the circumstances under which a Borel function f : S → R is of the form f(x, y) = u(x) + v(y), where u : X → R and v : Y → R are Borel. This turns out to be a special case of the problem of determining whether a real-valued Borel cocycle on a countable Borel equivalence relation is a coboundary. We use several Glimm-Effros style dichotomies to give a solution to this problem in terms of certain σ-finite measures on the underlying space. The main new technical ingredient is a characterization of the existence of type III measures of a given cocycle. Suppose that S ⊆ X×Y and G is a group. A coordinatewise decomposition of a function f : S → G is a pair (u, v), where u : X → G, v : Y → G, and ∀(x, y) ∈ S (f(x, y) = u(x)v(y)). If X and Y are Polish spaces, G is a standard Borel group, and u and v are Borel, then we say that (u, v) is a Borel coordinatewise decomposition of f . Our main goal here is to show that when S is a Borel set with countable sections, f : S → G is Borel, and G = 〈R,+〉, the existence of a Borel coordinatewise decomposition can be characterized in terms of certain σ-finite measures on the disjoint union of X and Y (by a measure on a Polish space, we shall mean always a measure on its Borel subsets). Before getting to this, however, we consider first the existence of coordinatewise decompositions, without imposing any definability restrictions. ∗The author was supported in part by NSF VIGRE Grant DMS-0502315.