Hi

I have a function that takes two arguments, performs a http request and then returns the response as a string into the cell which the function was called in.

My problem is that in my use case this function exists in multiple cells (> 100) where the http request is being performed 100's of times and so the cells way too long to populate because of all the requests being made.

The api I'm using is capable of taking an array of arguments and returning an array of results, so in theory I could perform a single, quick http request, but I'm unsure how to do take advantage of this and still have the same function being executed in different cells independent to one another.

Is there a way I can intercept the functions just before excel calls them, group them together, execute a single http call and then divide the response between each function?

Here's a diagram just to make it clear what I am trying to do:

cell --> function --> returns value --> cell

cell --> function --> http request --> returns value --> cell

cell --> function --> returns value --> cell


and here is what I'm doing at the moment:

cell --> function --> http request --> returns value --> cell

cell --> function --> http request --> returns value --> cell

cell --> function --> http request --> returns value --> cell