formatted_range function

Compute range and format it