# Logic: How to get a list of numbers between two values

**URL:** <https://forum.dynamobim.com/t/logic-how-to-get-a-list-of-numbers-between-two-values/62446>\
**Category:** Lists-Logic\
**Created:** [April 1, 2021, 7:48pm UTC](https://forum.dynamobim.com/t/logic-how-to-get-a-list-of-numbers-between-two-values/62446 "2021-04-01T19:48:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Redrunner262](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/redrunner262/32/118682_2.png) [@Redrunner262](https://forum.dynamobim.com/u/Redrunner262)\
**Post date:** [April 1, 2021, 7:48pm UTC](https://forum.dynamobim.com/t/logic-how-to-get-a-list-of-numbers-between-two-values/62446/1 "2021-04-01T19:48:46Z")

</div>

I’m trying to get a list which provides numbers between two values, a low number and a high number. In other words, I’m looking for a range between two numeric values. This is what I have. I want a list which returns “True” for indices 3 through 4. How do I achieve such a list? Does the “Or” node not work with lists?

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/8/58c351f3009de29a273ee25d3b029e2313488cf2.png)

---

<div class="post-metadata">

**Author:** ![SeanP](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/seanp/32/42560_2.png) [@SeanP](https://forum.dynamobim.com/u/SeanP)\
**Post date:** [April 1, 2021, 8:43pm UTC](https://forum.dynamobim.com/t/logic-how-to-get-a-list-of-numbers-between-two-values/62446/2 "2021-04-01T20:43:18Z")

</div>

Can you make a simple design script work?

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

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [April 1, 2021, 8:48pm UTC](https://forum.dynamobim.com/t/logic-how-to-get-a-list-of-numbers-between-two-values/62446/3 "2021-04-01T20:48:27Z")

</div>

Two things here: 1) You’re using the wrong type of OR node and 2) you really want an AND operation instead.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/9/c/9cc0d8626581698ba36a4be12bed36a8572a79e5.png)  
The node you’re using takes individual inputs, not lists. You want the list nodes (|| and &&), specifically the AND node (&&) to check which inputs in both lists are true.

As @SeanP has pointed out, you can also combine these conditional checks into one statement with DesignScript: `x >= 3 && x <= 4;`

---

<div class="post-metadata">

**Author:** ![Redrunner262](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/redrunner262/32/118682_2.png) [@Redrunner262](https://forum.dynamobim.com/u/Redrunner262)\
**Post date:** [April 1, 2021, 8:50pm UTC](https://forum.dynamobim.com/t/logic-how-to-get-a-list-of-numbers-between-two-values/62446/4 "2021-04-01T20:50:40Z")

</div>

That works for me with simple lists, but I don’t see how to use this approach in my example. I am an amateur at best in regards to using DesignScript.

---

<div class="post-metadata">

**Author:** ![Redrunner262](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/redrunner262/32/118682_2.png) [@Redrunner262](https://forum.dynamobim.com/u/Redrunner262)\
**Post date:** [April 1, 2021, 8:52pm UTC](https://forum.dynamobim.com/t/logic-how-to-get-a-list-of-numbers-between-two-values/62446/5 "2021-04-01T20:52:48Z")

</div>

That’s it, thank you! Good point on the AND rather than OR, I had not fully thought through the logic of my query prior to posting.  
Now I understand where @SeanP was pointing; I was in need of extra help, which you provided.
