I guess my point is that the model is where the doors, rooms and apartments spatially reside. It would make more sense to get the model generating and outputting these figures to an external data source rather than pushing them in from an uncontrolled data table. I appreciate that often the authors of these tables aren’t Revit capable, so it’s easier to handle data outside the model, but it can be counter intuitive and discrepancies easily emerge this way (I’ve had many bad experiences with similar cases, and the BIM team always gets the blame if the source of truth isn’t actually true). I am assuming the data you have in excel/csv came from a model originally, or has some bearing to it.
I would suggest storing apartment number in the rooms (assume you have multiple rooms forming an apartment), and then their room number is their number. If their number is repeated across apartments, use a shared parameter for that and then jam them together to form the number using Dynamo. Moreorless how the sample and script I sent works, please have a look at it if you haven’t yet.
If you must work with a schedule, then the groupbykey node is what you should use. Filter down the part(s) you need, then group them by their apartment+room no as keys. How you line this back up to the model depends on what your data in the model looks like - ideally a room has a matching Id or number to excel and you can use that to find the index of where it occurs as a room, then set your chosen values in excel to their respective storage parameters. Dynamo has no way of matching data to rooms if no data is align-able between them unfortunately.