I need help creating a custom function for Google Sheets using Google AppScript. My goal is to summarize data and display the summary on a different sheet.
I have already developed an algorithm for the summary that returns a range, similar to the following:
Original
https://i.sstatic.net/OpM3G.png
However, I am facing a challenge in merging cells based on specific criteria, such as months. I want to achieve a layout like this:
Desired Outcome
https://i.sstatic.net/fUwnZ.png
In the example above, the range returned by my custom function will look like this:
[
['January', ''],
['Project 1', '10 Hours'],
['Project 2', '20 Hours'],
['Project 3', '30 Hours'],
['Project 4', '40 Hours'],
['Project 5', '50 Hours'],
['February', ''],
['Project 1', '10 Hours'],
['Project 2', '20 Hours'],
['Project 3', '30 Hours'],
['Project 4', '40 Hours'],
['Project 5', '50 Hours']
]
I am unsure how to instruct AppScript to merge cells like ['January', ''],
and ['February', ''],
. Any suggestions or alternative methods, possibly from Excel functions, are welcome! :)
Thank you!