If you're a user of Excel 2016 or a newer version, there's a handy Excel add-in known as Funfun available in the add-in store. It allows you to write and execute JavaScript code directly within Excel, with access to the data stored in your spreadsheet. Take a look at this screenshot showcasing how it appears in Excel 2016.
https://i.sstatic.net/VS1ei.png
In the middle of the interface, there's a section where you can input JavaScript, CSS, and HTML code - essentially like a playground integrated into Excel. Moreover, Funfun offers an online editor for testing the code. Here's a link to an example provided in the first picture for you to experiment with.
https://i.sstatic.net/KYHpY.png
The unique feature of the Funfun online editor is its 'spreadsheet' resembling Excel that enables testing code directly on your data. While no formatting options are available, you can simply copy data into cells and test your code. To utilize the spreadsheet data, just configure the short.io file in Funfun by specifying the data location in the spreadsheet to JavaScript. For instance, in the shared example, you'd need to specify:
{
"data": "=A2:B9"
}
Within the JavaScript code, use the object $internal to read the data. To access the data in A2:B9, the code would be:
var data = $internal.data;
That's it! If you wish to delve deeper, refer to the documentation of Funfun for more insights.
If content with the results achieved in the online editor, easily load them into your Excel using the provided URL. Initially, insert the Funfun add-in via Insert - My add-ins. Refer to these screenshots illustrating the process.
https://i.sstatic.net/VYfcY.png
https://i.sstatic.net/gnD1s.png
Disclaimer: I'm one of the developers behind Funfun.