# Check if a numberList contains a particular value

**URL:** <https://cl.desmos.com/t/check-if-a-numberlist-contains-a-particular-value/2286>\
**Category:** Questions\
**Created:** [January 3, 2021, 1:00am UTC](https://cl.desmos.com/t/check-if-a-numberlist-contains-a-particular-value/2286 "2021-01-03T01:00:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shaun\_Carter](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/shaun_carter/32/1848_2.png) [@Shaun\_Carter](https://cl.desmos.com/u/Shaun_Carter)\
**Post date:** [January 3, 2021, 1:00am UTC](https://cl.desmos.com/t/check-if-a-numberlist-contains-a-particular-value/2286/1 "2021-01-03T01:00:44Z")

</div>

Is there a function or attribute which checks whether a numberList contains a particular number? (Or equivalently, whether a number is included in a numberList.)

If not, any chance there’s something coming? Please? 😉

Use case: I have a list of numbers in a column of a table. I know I can use table.columnNumericValues to get that list as a numberList. I want students to choose one of these numbers to use elsewhere on the screen, but currently they can input any number they like, even if it’s not in the table. The activity still works if they do this, but they can make it easier than I intended by using their own values.

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [January 3, 2021, 1:24am UTC](https://cl.desmos.com/t/check-if-a-numberlist-contains-a-particular-value/2286/2 "2021-01-03T01:24:31Z")

</div>

You totally can, but you need a graph component to do it reliably (unless you know how many rows are in your table)

> **[number from a list • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/5ff11b9ab5a0ab0b9c92a173)**
>
> by Jay Chow

---

<div class="post-metadata">

**Author:** ![Shaun\_Carter](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/shaun_carter/32/1848_2.png) [@Shaun\_Carter](https://cl.desmos.com/u/Shaun_Carter)\
**Post date:** [January 3, 2021, 1:40am UTC](https://cl.desmos.com/t/check-if-a-numberlist-contains-a-particular-value/2286/3 "2021-01-03T01:40:26Z")

</div>

Awesome! Would not have thought to do it that way.  
What if I do know how many rows there are? I do in this case.

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [January 4, 2021, 2:21pm UTC](https://cl.desmos.com/t/check-if-a-numberlist-contains-a-particular-value/2286/4 "2021-01-04T14:21:31Z")

</div>

A graph will still work, but if you want to (either for performance reasons or to avoid using a graph altogether), you could check that it matches each cell individually.
