Copy / translate family instances by x amount in Y axis


I’m working on a graph to take an excel schedule of accommodation and push these into Revit as masses. I have this working as shown in the image below:

MassesFromExcelv2.dyn (124.8 KB)

The problem with the above graph was / is that a unique family is generated for every single room, so I end up with 58 different family types.

What I want is for the script to create one family type per room (Proposed Function) type, and then have multiple instances of these. A family type would be generated for each room (Proposed Function) type, and then be arrayed (translated multiple times?) by the value in the ‘Quantum’ column.

Is anyone able to help me with figuring out how I would achieve this? I would ideally like them copied in the y axis, as per the image below:

Current graph below which generates one family type per Room (Proposed Function) type:

MassesFromExcelv3.dyn (134.6 KB)
Room Test1.xlsx (16.4 KB)

Many thanks in advance.