From the Architect Machines website:
Cost Analysis Script v1.0
By Ryan Cameron
This script will find all the enclosed rooms in your Revit model, calculate areas by asset name (e.g. Commons, Dorms, Corridor – you create the definition)
It will calculate the square footages and feed that back into your Excel document. The Option selection in the excel document will then update those asset types in accordance with the color/option selected AFTER hitting save and Dynamo is set to Automatic.