Please post code between CODE tags to retain indentation and readablity. Use # icon on edit toolbar.

Sure, most anything is possible. But I don't quite understand the "following values in d3:d9 and so on" requirement. What are "following values" and what is meant by "and so on". Perhaps you should attach file and include a sheet that shows what you result you want.