# Coloring rooms based on the excel file values

**URL:** <https://forum.dynamobim.com/t/coloring-rooms-based-on-the-excel-file-values/24687>\
**Category:** Revit\
**Tags:** revit, excel, dynamo, color-override, rooms\
**Created:** [August 10, 2018, 10:09am UTC](https://forum.dynamobim.com/t/coloring-rooms-based-on-the-excel-file-values/24687 "2018-08-10T10:09:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohammadarslan](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@mohammadarslan](https://forum.dynamobim.com/u/mohammadarslan)\
**Post date:** [August 10, 2018, 10:09am UTC](https://forum.dynamobim.com/t/coloring-rooms-based-on-the-excel-file-values/24687/1 "2018-08-10T10:09:12Z")

</div>

Hi

With the reference to the previous post ([Shading rooms using CSV file values](https://forum.dynamobim.com/t/shading-rooms-using-csv-file-values/24640/2)), I am trying to color the rooms based on the values taken from the excel file. I have taken rooms data from the Revit model and imported data from the excel file. But I don’t know how to set the threshold to color the rooms. For example; Room value \> 20 have the color “Red”. I am attaching the file below.

[Home.dyn](https://forum.dynamobim.com/uploads/short-url/poVGU5bJI8H7S13LVmxo9XusZuV) (7.3 KB)

**Excel data: Columns are Room Name| Room Number | Room Value**

|Room|1|20|  
|Room|2|30|  
|Room|3|40|  
|Room|4|50|  
|Room|5|60|  
|Room|6|70|

![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/d/fdc23da4176fdb709aa8eaa2c493152a10472e57.png)

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/e/9ecf6dc8d9bdd25b18d517493694b2d083f3db20.png)

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [August 10, 2018, 10:17am UTC](https://forum.dynamobim.com/t/coloring-rooms-based-on-the-excel-file-values/24687/2 "2018-08-10T10:17:50Z")

</div>

Maybe something like:

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/2/f25fac16e3378e09587944d666d28b386c927dfc.png)

Then you just need to apply the “color-override” to the room

---

<div class="post-metadata">

**Author:** ![mohammadarslan](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@mohammadarslan](https://forum.dynamobim.com/u/mohammadarslan)\
**Post date:** [August 10, 2018, 1:24pm UTC](https://forum.dynamobim.com/t/coloring-rooms-based-on-the-excel-file-values/24687/3 "2018-08-10T13:24:49Z")

</div>

Thank you for your reply. Your code block is not working i dont know why ?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/f/0/f0a3ff0d8d553135286b6d24bcd5b1c4c4cd4470.png) [Home.dyn](https://forum.dynamobim.com/uploads/short-url/tXeCTE888VWepv8lHYXzELCVkG8) (13.8 KB)

---

<div class="post-metadata">

**Author:** ![mellouze](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mellouze](https://forum.dynamobim.com/u/mellouze)\
**Post date:** [August 10, 2018, 1:31pm UTC](https://forum.dynamobim.com/t/coloring-rooms-based-on-the-excel-file-values/24687/5 "2018-08-10T13:31:43Z")

</div>

You are not using the right nodes for the colors. @Jonathan.Olesen didn’t use OotB nodes (i guess ?).

Use **Color.ByARGB** node and define your color or use the Palette.

---

<div class="post-metadata">

**Author:** ![Jonathan.Olesen](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jonathan.olesen/32/44242_2.png) [@Jonathan.Olesen](https://forum.dynamobim.com/u/Jonathan.Olesen)\
**Post date:** [August 10, 2018, 1:40pm UTC](https://forum.dynamobim.com/t/coloring-rooms-based-on-the-excel-file-values/24687/6 "2018-08-10T13:40:06Z")

</div>

@mellouze As it says over my “color-nodes” they are from Clockwork… the OOTB way of making them is shown by @erfajo

@mohammadarslan You have not written either the “if-statement” (first codeblock) or the “transpose” block correctly…

Unless of course you only want two colors in which case there is no reason to use three colors… I’m just trying to show you an option not give you the entire solution. That way you might even learn a little from this adventure 🙂

The logic behind the if-statement is:

if x \< 40 then return “Red”  
if x \< 60 then return “Blue”  
else return “Green”

And I’m only using the first two sub-lists (lst[0],lst[1]) in the transpose as the third list (lst2) is exchanged for actual colors rather than “values”…

Generally you can identify “function” by the color of the “header” of the nodes…  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/4/9/490041ebc7aecab921490bd352fdbb16a3f73981.png)

---

<div class="post-metadata">

**Author:** ![mellouze](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@mellouze](https://forum.dynamobim.com/u/mellouze)\
**Post date:** [August 10, 2018, 1:41pm UTC](https://forum.dynamobim.com/t/coloring-rooms-based-on-the-excel-file-values/24687/7 "2018-08-10T13:41:53Z")

</div>

> [@Jonathan.Olesen](#):
>
> they are from Clockwork

Oh right, sorry, did not saw that ☹

---

<div class="post-metadata">

**Author:** ![mohammadarslan](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@mohammadarslan](https://forum.dynamobim.com/u/mohammadarslan)\
**Post date:** [August 10, 2018, 1:42pm UTC](https://forum.dynamobim.com/t/coloring-rooms-based-on-the-excel-file-values/24687/8 "2018-08-10T13:42:53Z")

</div>

Thank you for your reply. I will change my nodes 🙂

---

<div class="post-metadata">

**Author:** ![mohammadarslan](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@mohammadarslan](https://forum.dynamobim.com/u/mohammadarslan)\
**Post date:** [August 10, 2018, 2:08pm UTC](https://forum.dynamobim.com/t/coloring-rooms-based-on-the-excel-file-values/24687/10 "2018-08-10T14:08:18Z")

</div>

@Jonathan.Olesen I have now corrected it 🙂

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/6/a/6aba5e08dec2e76bf3ae4fb6462e47633d8b22ec.png)

---

<div class="post-metadata">

**Author:** ![qwaider](https://avatars.discourse-cdn.com/v4/letter/q/9dc877/32.png) [@qwaider](https://forum.dynamobim.com/u/qwaider)\
**Post date:** [March 4, 2020, 8:42pm UTC](https://forum.dynamobim.com/t/coloring-rooms-based-on-the-excel-file-values/24687/11 "2020-03-04T20:42:12Z")

</div>

hello,  
I am quiet a beginner in Dynamo, but I am try to do something very similar to what you did here, change colors of rooms based on excel data that I have.I would really appreciate any leads or hints where to start and how to do it 🙂
