Let D be a subset of a finite commutative ring R with identity. Let f(x)∈R[x] be a polynomial of positive degree d. For integer 0≤k≤∣D∣, we study the number Nf(D,k,b) of k-subsets S⊆D such that \begin{align*} \sum_{x\in S} f(x)=b. \end{align*} In this paper, we establish several asymptotic formulas for Nf(D,k,b), depending on the nature of the ring R and f. For R=Zn, let p=p(n) be the smallest prime divisor of n, ∣D∣=n−c≥Cdnp−d1+c and f(x)=adxd+⋯+a0∈Z[x] with (ad,…,a1,n)=1. Then Nf(D,k,b)−n1(kn−c)≤(kδ(n)(n−c)+(1−δ(n))(Cdnp−d1+c)+k−1), partially answering an open question raised by Stanley \cite{St}, where δ(n)=∑i∣n,μ(i)=−1i1 and Cd=e1.85d. Furthermore, if n is a prime power, then δ(n)=1/p and one can take Cd=4.41. For R=Fq of characteristic p, let f(x)∈Fq[x] be a polynomial of degree d not divisible by p and D⊆Fq with ∣D∣=q−c≥(d−1)q+c. Then Nf(D,k,b)−q1(kq−c)≤(kpq−c+pp−1((d−1)q21+c)+k−1). If f(x)=ax+b, then this problem is precisely the well-known subset sum problem over a finite abelian group. Let G be a finite abelian group and let D⊆G with ∣D∣=∣G∣−c≥c. Then Nx(D,k,b)−∣G∣1(k∣G∣−c)≤(kc+(∣G∣−2c)δ(e(G))+k−1), where e(G) is the exponent of G and δ(n)=∑i∣n,μ(i)=−1i1. In particular, we give a new short proof for the explicit counting formula for the case D=G.