how to calculate range and domain - Search