# Fix value of calculated cell

**URL:** <https://community.glideapps.com/t/fix-value-of-calculated-cell/21968>\
**Category:** Ask for Help\
**Created:** [January 29, 2021, 11:58pm UTC](https://community.glideapps.com/t/fix-value-of-calculated-cell/21968 "2021-01-29T23:58:51Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![gp9293](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gp9293/32/16743_2.png) [@gp9293](https://community.glideapps.com/u/gp9293)\
**Post date:** [January 29, 2021, 11:58pm UTC](https://community.glideapps.com/t/fix-value-of-calculated-cell/21968/1 "2021-01-29T23:58:51Z")

</div>

I have a math cell that computes the value x/y on a regular basis. x is a fixed number, but y changes every few hours. I want to lock in the value of y so there is a starting point for x/y, let y update, then compare each updated value of x/y to the locked in starting point of x/y. Appreciate any direction on how to lock in the initial value of y. Thank you.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [January 30, 2021, 12:12am UTC](https://community.glideapps.com/t/fix-value-of-calculated-cell/21968/2 "2021-01-30T00:12:15Z")

</div>

I think the direction you need is to have 2 columns of Y. “Original Y” and “Updated Y”, updates would only write to the “Updated Y” column. Then you have 2 math columns to compare.

---

<div class="post-metadata">

**Author:** ![gp9293](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gp9293/32/16743_2.png) [@gp9293](https://community.glideapps.com/u/gp9293)\
**Post date:** [January 30, 2021, 12:15am UTC](https://community.glideapps.com/t/fix-value-of-calculated-cell/21968/3 "2021-01-30T00:15:55Z")

</div>

Agree, but need to determine how to fix the value of y at some point in time, as it is updated throughout the day. In Sheets, I would copy y and paste special using the value. There should be a more elegant way to do this in a Sheet with thousands of rows. What do you think?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [January 30, 2021, 12:17am UTC](https://community.glideapps.com/t/fix-value-of-calculated-cell/21968/4 "2021-01-30T00:17:47Z")

</div>

So you don’t have a fixed logic to lock in the Y?

---

<div class="post-metadata">

**Author:** ![gp9293](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gp9293/32/16743_2.png) [@gp9293](https://community.glideapps.com/u/gp9293)\
**Post date:** [January 30, 2021, 12:18am UTC](https://community.glideapps.com/t/fix-value-of-calculated-cell/21968/5 "2021-01-30T00:18:03Z")

</div>

Correct.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [January 30, 2021, 12:18am UTC](https://community.glideapps.com/t/fix-value-of-calculated-cell/21968/6 "2021-01-30T00:18:54Z")

</div>

How are you updating the Y now? I assume it’s a manual update from the app?

---

<div class="post-metadata">

**Author:** ![gp9293](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gp9293/32/16743_2.png) [@gp9293](https://community.glideapps.com/u/gp9293)\
**Post date:** [January 30, 2021, 12:19am UTC](https://community.glideapps.com/t/fix-value-of-calculated-cell/21968/7 "2021-01-30T00:19:41Z")

</div>

Y is updated automatically from Google Finance in the Sheet.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [January 30, 2021, 12:23am UTC](https://community.glideapps.com/t/fix-value-of-calculated-cell/21968/8 "2021-01-30T00:23:16Z")

</div>

As you use Google Finance, which is not available in Glide, I think your best bet is to have an additional Script and a boolean column, let’s call it “Locked?”.

If Locked is not True then set the Google Finance formula to the column “Y original”.

If Locked is True then copy and paste the “Y original” value to that same cell to lock it in, and then set the Google Finance formula to the column “Y updated”.

You would have to set the boolean column yourself, from the app.

---

<div class="post-metadata">

**Author:** ![gp9293](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gp9293/32/16743_2.png) [@gp9293](https://community.glideapps.com/u/gp9293)\
**Post date:** [January 30, 2021, 12:24am UTC](https://community.glideapps.com/t/fix-value-of-calculated-cell/21968/9 "2021-01-30T00:24:59Z")

</div>

Thank you. Will give it a look.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [January 30, 2021, 12:49am UTC](https://community.glideapps.com/t/fix-value-of-calculated-cell/21968/10 "2021-01-30T00:49:13Z")

</div>

What kind of value are you trying to lock in? Is it possible to set up google finance to pull a value from a certain day or time? I’m not really sure, just wondering if it’s possible to get what you need by setting up a second formula.

---

<div class="post-metadata">

**Author:** ![gp9293](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gp9293/32/16743_2.png) [@gp9293](https://community.glideapps.com/u/gp9293)\
**Post date:** [January 30, 2021, 1:14am UTC](https://community.glideapps.com/t/fix-value-of-calculated-cell/21968/11 "2021-01-30T01:14:45Z")

</div>

I wound up simplifying the use case and was able to arrive at a solution. Requires user to enter a little bit of data, but is a good trade-off to avoid some of the complexities that are popping up around this issue. But, yes, down the road a script that will pull data at a point in time is likely the answer. As always, thanks to you both for your prompt and insightful anwers.
