如何保存在if条件下使用的单元格值 .

例:

if(m1 = "completed", g1 = g2, g1=g1)

如果condition为true,则g1的值将更改为g2的值,否则g1将保留其值 .

我如何在谷歌表中这样做?