# Better logic formulas greater than, smaller than

**URL:** <https://community.homey.app/t/better-logic-formulas-greater-than-smaller-than/32534>\
**Category:** Questions & Help\
**Created:** [July 18, 2020, 10:49am UTC](https://community.homey.app/t/better-logic-formulas-greater-than-smaller-than/32534 "2020-07-18T10:49:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![HanZ](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hanz/32/18371_2.png) [@HanZ](https://community.homey.app/u/HanZ)\
**Post date:** [July 18, 2020, 10:49am UTC](https://community.homey.app/t/better-logic-formulas-greater-than-smaller-than/32534/1 "2020-07-18T10:49:25Z")

</div>

Can’t figure out how to tell better logics to check if a number is between two specified limits

Anyone?

[https://homey.app/f/bUcyxd](https://homey.app/f/bUcyxd)

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [July 18, 2020, 11:01am UTC](https://community.homey.app/t/better-logic-formulas-greater-than-smaller-than/32534/2 "2020-07-18T11:01:50Z")

</div>

Try `{{1 < Energie < 10}}` or `{{Energie > 1 and Energie < 10}}`

---

<div class="post-metadata">

**Author:** ![HanZ](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hanz/32/18371_2.png) [@HanZ](https://community.homey.app/u/HanZ)\
**Post date:** [July 18, 2020, 11:13am UTC](https://community.homey.app/t/better-logic-formulas-greater-than-smaller-than/32534/3 "2020-07-18T11:13:55Z")

</div>

tried all combinations, with dash, without a dash. not working

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [July 18, 2020, 11:25am UTC](https://community.homey.app/t/better-logic-formulas-greater-than-smaller-than/32534/4 "2020-07-18T11:25:58Z")

</div>

This works for me:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/4/84e28fc1e517f41fb722cc59e15818100de095e9.png)

Note that I didn’t add `{{` and `}}`; that’s not Better Logic syntax but “regular” Logic. I also had to add parentheses around each subexpression to get it working.

---

<div class="post-metadata">

**Author:** ![HanZ](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/hanz/32/18371_2.png) [@HanZ](https://community.homey.app/u/HanZ)\
**Post date:** [July 18, 2020, 12:22pm UTC](https://community.homey.app/t/better-logic-formulas-greater-than-smaller-than/32534/5 "2020-07-18T12:22:26Z")

</div>

Works, thnx. Learning every day…
