One of the simplest formulas for calculating distance (found it in this paper) is:
RSSI = -20 * logd + TxPower (where d = distance)
Which gives you this:
d = 10 ^ ((TxPower - RSSI) / 20)
This will give you very “jumping” results, coming from the nature of RSSI. RSSI readings are not very stable and highly depend on environment. I’m pretty sure Estimotes uses much mores sophisticated formula that also enables some kind of “smoothing” of data, so the readings are more stable. But this will be a good start to get at least some approximation.