# Add Value of Variables Together

**URL:** <https://cl.desmos.com/t/add-value-of-variables-together/2239>\
**Category:** Questions\
**Created:** [December 17, 2020, 8:00pm UTC](https://cl.desmos.com/t/add-value-of-variables-together/2239 "2020-12-17T20:00:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nora\_Oswald](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/nora_oswald/32/1597_2.png) [@Nora\_Oswald](https://cl.desmos.com/u/Nora_Oswald)\
**Post date:** [December 17, 2020, 8:00pm UTC](https://cl.desmos.com/t/add-value-of-variables-together/2239/1 "2020-12-17T20:00:29Z")

</div>

I’m trying to display the sum of a few variables. How do I do that? Here is the code I have so far…

a= when ans2.numericValue=25 1 otherwise 0

b = when ans3.numericValue=5 1 otherwise 0

c = when ans4.numericValue=16 1 otherwise 0

I want display the sum of these three variables.

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [December 17, 2020, 8:23pm UTC](https://cl.desmos.com/t/add-value-of-variables-together/2239/2 "2020-12-17T20:23:47Z")

</div>

Any time you want to do calculations in the CL you’ll need to use `numericValue`.

```auto
content: "The sum is ${ numericValue("${a}+${b}+${c}") }."

```

or

```auto
sum=numericValue("${a}+${b}+${c}")
content: "The sum is ${sum}."

```

If you want to display in a table instead, just replace `content` with `cellContent(row, column)`.

---

<div class="post-metadata">

**Author:** ![Nora\_Oswald](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/nora_oswald/32/1597_2.png) [@Nora\_Oswald](https://cl.desmos.com/u/Nora_Oswald)\
**Post date:** [December 17, 2020, 8:35pm UTC](https://cl.desmos.com/t/add-value-of-variables-together/2239/3 "2020-12-17T20:35:40Z")

</div>

Perfect! Thank you, that’s exactly what I needed. 🙂
