# Memory cell

Too much glide sheets and now my brain is lost on a simple problem:
One cell can change value. I have a condition that stores that value on a different cell only if a condition is true. Else… the second cell must keep that value:
Cell condition result
x 1 x
y 1 x
y 0 y
It is like a memory cell. I would like to use only Glide sheet for speed.
This applies on a multi-rows sheet, one row per each user and one of the above condition/result per each row. If…Then doesn’t work due to the “else” condition that erases the value.
Best way to do it? My brain thank you!!

If you set the else condition to point to the original cell, you should be ok.

Assuming columns are a b c

If b = 1 then x
If b = 0 then a

Consider adding a series of columns: 1 new Boolean column per condition. These will report a true/false outcome in each column. Once you have added as many columns (conditions) as you need add another column that is a template column. The template should be A B C… replacing A with condition A, B with condition B, etc… this will generate a list with permutations of ‘true true false’ or ‘true true true’, etc. Finally, you can add your outcome column with if/then/else based on the template containing whatever permutations are important.

Not sure how to point “else”, but let me try…Thanks!

Thank you Simon. I think it’s a good idea. Let me try!

Trying to explain better:

A cell (x) is i.e. “35”. I have a flag, that is 1 (or true). Another cell must show “35” as output.

If the cell (x) changes later on to i.e. 36, the output must stay at the old value 35.

Only if the flag changes to false then both values (x and output) are again in sync.

Not able to do it with your solutions, maybe I did wrong. Can you explain or send me just a picture on how to accomplish that?

• Create a 4th column, call it (for example) IF-Y
• Make that column an if-then-else
• If flag is true, then Y
• Else X

Did I understand correctly?

Well, the problem I believe is slightly different: I have 1 row, and X can change. I need to “memorize” its value if Flag is true. Therefore, we have the following 3 possible conditions (example):
X Flag Result (Y)
29 true 29

Soon after (in time) X changes (flag still true):
X Flag Result (Y)
55 true 29
Where Y stays at the previous value 29, despite the input X has changed!
And after, if Flag changes to false, the result (Y) will follow X as usual:

X Flag Result (Y)
55 false 55

Etc…etc…
It looks very easy, but I found it tricky with Glide. I solved now with a different approach (a one-shot “copy”) but it should be very interesting to know how to do it in the easiest and efficient way. Thanks for your help!!

hmm, does my example not address this?

To be clear, with my solution I am suggesting that you read the value of “IF-Y” as your “Y” value.

1 Like

I have come across similar situations where I want to “pause” a value or get it to stick. This is the same issue with Google sheets as well as glide tables. Computations happen in real time, so you usually can’t get a value to stick, because those IF statements are always checking and rechecking. In google sheets, this is usually handled programmatically through a script. I think in glide it would be better to set the logic up in a compound action. If a flag is set, then don’t overwrite the column value. If the flag is not set, then it can be overwritten. Might be easier than trying to keep track of several If Then columns that try to do the same logic.

2 Likes

I tried and copied the “IF” example exactly how you did, but Y shows always 0.

I agree, Jeff. Matter of fact I used an action and it works perfectly. Thanks.

1 Like