Abstract. Let G be a graph. Its Wiener index W(G) is the sum of distances between all (unordered) pairs of vertices of G. Its edge-Wiener We(G) is the sum of distances between all (unordered) pairs of edges of G. Its Gutman index is the sum of products of the degrees with the distance, taken over all (unordered) pairs of vertices of G. In the paper we prove an equality involving edge-Wiener index, Gutman index and numbers of specific configuration. As a consequence we obtain that for every connected graph G with minimum degree d it holds

We(G)≥(d2/4)W(G),

and the equality is attained only if G is a path on three verties or a cycle. We also show that the fraction We(G)/W(G) is at least (n-2)/(2n-2) and the minimum is attained only for the star on n vertices.