I just wanted to follow up to my earlier post. Your script does not work well if there is more than one sheet in the spreadsheet or, in fact, it will work in applied in the first sheet. My case was that I utilized it in 4th sheet and that is why I never saw the results (till now) - because it created the results in 1st sheet. So, for generality, you should adjust the script to work within any script, such that you should insert the sheet name in the formula. I tried to enter it manually in your form, but it didn't accept it. Never mind. I sent you this note in private, but I am writing this publicly as a head-up to other users.
In any case, your script was useful to demonstrate a convenient syntax for the formula that does the job without printing those "Date" and "Close" labels.