# If Statement

**URL:** <https://forum.inductiveautomation.com/t/if-statement/6102>\
**Category:** Ignition\
**Created:** [March 26, 2013, 1:57am UTC](https://forum.inductiveautomation.com/t/if-statement/6102 "2013-03-26T01:57:14Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![accyroy](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/accyroy/32/3386_2.png) [@accyroy](https://forum.inductiveautomation.com/u/accyroy)\
**Post date:** [September 12, 2017, 10:21am UTC](https://forum.inductiveautomation.com/t/if-statement/6102/5 "2017-09-12T10:21:59Z")

</div>

You can’t evaluate a greater than or less than in a switch function. A workaround as per [this thread](http://forum.inductiveautomation.com/t/expression-language-switch-upgrade/549/5) is to use binEnum like this:

```auto
switch(
  binEnum({Brac Tags/Analog_In/PET_150}=1,
          {Brac Tags/Analog_In/PET_150}>50,
          {Brac Tags/Analog_In/PET_150}<25),
1,2,3,
'color(217,0,0)', //result 1 
'color(217,217,0)', //result 2 
'color(0,0,0)', //result 3 
'none') //default

```

The manual page for Switch is [here](https://docs.inductiveautomation.com/display/DOC79/switch).

---

_[View the full topic](https://forum.inductiveautomation.com/t/if-statement/6102)._
