# Stuck getting NaN trying to add numbers in a column

**URL:** <https://community.thunkable.com/t/stuck-getting-nan-trying-to-add-numbers-in-a-column/4097838>\
**Category:** Questions about Thunkable X\
**Created:** [August 19, 2025, 12:33am UTC](https://community.thunkable.com/t/stuck-getting-nan-trying-to-add-numbers-in-a-column/4097838 "2025-08-19T00:33:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sdmahaney\_sla](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sdmahaney_sla/32/209079_2.png) [@sdmahaney\_sla](https://community.thunkable.com/u/sdmahaney_sla)\
**Post date:** [August 19, 2025, 12:33am UTC](https://community.thunkable.com/t/stuck-getting-nan-trying-to-add-numbers-in-a-column/4097838/1 "2025-08-19T00:33:23Z")

</div>

This seems to be a popular topic. I think I’m following what has solved other people’s issues, but it’s not working and I’m not seeing why.

On this screen the user picks a list of foods and a quantity of each. The quantities and food item data are copied to a temporary table. The temporary table is being populated correctly.

On hitting the save button the rows from the temporary table are added to the end of a permanent table (I’m not even bothering with the quantities for now).

A loop runs trying to add the nutrient quantities in each column, adding each new value to the previous value. Here is where I’m adding zero to each item to force an “as number”.

Then these subtotals are written to a new row in a table of meals.

A debugging label confirms that the subtotal object is being started as a row of zeroes under the correct headers.

I’ve gone back through and checked that there are no extra characters in the source data tables - it’s just numbers. It sure looks like I’m adding zero to each retrieved value. Where else should I be looking?

 ![Clip0002](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/b/1b0b9a9bf9558cdd2c43f27bc87e0afe4a525253.jpeg)

 ![Clip0003](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/2/325ca43c16815ee92b09e508e89721fef5c5a88f.jpeg)

 ![Clip0001](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/e/ce968dcd9461d129dad94ee89394bec30be37aaa.jpeg)

---

<div class="post-metadata">

**Author:** ![sdmahaney\_sla](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sdmahaney_sla/32/209079_2.png) [@sdmahaney\_sla](https://community.thunkable.com/u/sdmahaney_sla)\
**Post date:** [August 21, 2025, 10:50pm UTC](https://community.thunkable.com/t/stuck-getting-nan-trying-to-add-numbers-in-a-column/4097838/2 "2025-08-21T22:50:47Z")

</div>

I managed to get through this, using the “change by” block instead of setting the current value to itself plus the new data. Multiplication by the ‘quantity’ field is now included.

I’m still just adding zero to each item to force “as number” so I don’t know why it didn’t work the other way.

And I appreciate not having to declare every variable and field, but WTF isn’t “as number” a Thunkable block?? [or, here’s a wild idea, arithmetic operations could be smart enough to interpret inputs as numbers where possible]

 ![Clip0002](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/4/b447914914794582277d6b504a73450f865dba3a.jpeg)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [November 19, 2025, 10:51pm UTC](https://community.thunkable.com/t/stuck-getting-nan-trying-to-add-numbers-in-a-column/4097838/3 "2025-11-19T22:51:22Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
