Parametric optimization data to excel - new to python and ghpython

I am trying to run parametric one factor at a time simulations to run energy optimizations n my rhino model using honeybee. I want this resultant data to be displayed in an excel sheet as the following format - labels, baseline and 5 of the recent optimisation data as separate columns.
I amanges to get the format for the first three columns in excel. But I am struggling with 5 iterations for the optimization data.

Annotation 2024-07-09 114006

I am using the TTtoolbox to convert data to excel.
formatting script:

        import rhinoscriptsyntax as rs
        lst = [labels, simData]

        #save the new list as old list and add new data to new run if save is true
        lst.append(newRun)
        return lst

The problem is that the optimization data is input as the same variable as it is run repeatedly. How do i save that in memory and add it to the newrun data. Because it is run again, the memory refreshes. How do I do this?

I was thinking of maybe creating two separate scripts - one for formatting and one for combining the optimization results. But I am stuck on how to go about it. Here is where I am so far.

        import rhinoscriptsyntax as rs
        print(newRun)
        result = []
        memory = []
        result = result + newRun
        print(result)
        print(memory)
        memory = memory + newRun
        # return outputs if you have them; here I try it for you:
        return result

Any help would be much appreciated!