I would like for the result of a formula to stay in the cell even after the first cell changes.

in cell G1 I use this formula, if(C1=D10,A1,""), I would like result of formaula to remain in G1 even after C1 is changed. Can someone help?

Thanks