Conditional Color Change

Hi all, I’m trying to change the fill color of a rectangle based on 2 boolean values in Excel. The scenario involves changing the color of the rectangle representing a storage unit in a storage building. Is it rented or not.

There are 2 columns “isRented” and “isRentable.” I’d like to do something like:

If isRented=True make the color gray. If isRented=False AND isRentable=True make the color green.

Does anyone have any idea if this is possible and if so, how would you accomplish it?

Hi @jeffsne, you could do this a few ways. First, you could put the color hex code in excel, next to your isRented column. Set an action to change the rectangle color to whatever is in that cell. Or you could make two rectangles of each color, put them on top of each other. Then bind their visible value to the isRented value. So one colored rectangle is always showing, the other automatically goes invisible.

Thanks Alex… good ideas. Probably the easiest is to add colors to Excel since there are hundreds of units.

Glad to help! Yup, I would use that method if you’re looking to show many values at once, each with a corresponding color.

1 Like

Another way to simplify the problem could be to have one single variable with 3 values:

  • Rented
  • Not Rented & Not Available
  • Not Rented & Available

Thus you only have 1 column to look at, whether it contains a “rent” value or a hex color.