将列值从1更改为0

问题描述

我有一个1和0的列,我想改为相反。

|This   |Should be|
| 0     |1        |
| 1     |0        |
| 0     |1        |
| 1     |0        |
| 0     |1        |

我试图做=ARRAYFORMULA(SUBSTITUTE(A2:A,"0","1","")) 但这会将所有值更改为0,如果我执行Replace函数:(

有什么建议吗?

预先感谢

解决方法

使用:

=INDEX(IF(A1:A="",IF(A1:A*1=1,1)))

enter image description here

或:

=INDEX(IF(A1:A="",N(A1:A*1=0)))

enter image description here

,

尝试:

=-A1+1

enter image description here

我是在Excel上完成的,但它应该可以在Google表格上完美运行。