Can we compute the sum of a range of entries in $O(1)$ time?
Yes, calculation of range sum is possible in O(1) time.
Suppose the data is given in an array. You need to preprocess the array to find the prefix sums. For this you need another array. To find range sum S(i,j] you need to compute P[j]-P[i]. Where P[j] and P[i] are entries of prefix sum array. For example, the given array is:
4 5 -2 5 -77 45.
Corresponding prefix sum array is:
4 9 7 12 -65 -20.
So, S(2, 4] = -65 - 7 = -72 (Sum from 2 to 4, 2 excluded and zero based indexing)

Note: We preprocess the given data to build the prefix sum array which takes O(n) time where n is the number of entries. After that, each query of the form S(i,j] takes O(1) time.