convertRange function