如何在Excel中创build一个包含variables和string的公式?

我想要这一行:

./command.sh -id IDVAL -amount MONEY -assignment SIGNVAL -reason "goodjob" 

作为excel中的一个公式。 IDVAL在单元格A2MONEYB2SIGNVALC2 (对于第一行,对于第二行, IDVALA3 ,在B3 IDVAL MONEY )。

为了使这个公式,我试过的是

 ./command.sh -id =A2 -amount =B2 -assignment =C2 -reason "goodjob" 

但它将=A2识别为一个string(不读取A2 )。 我怎样才能读取A2单元格中的内容,而不是将它作为string?

编辑:我复制粘贴到Excel的顶部附近的单元格/“FX”栏。 我也试过了

 ./command.sh -id =evaluate(=A2) 

但是这也行不通。

使用&符号连接string:

 ="./command.sh -id "&A2&" -amount "&B2&" -assignment "&C2&" -reason "&CHAR(34)&"goodjob"&CHAR(34) 

我经常用CHAR(34)作为双引号字符。

但是你也可以通过把它们翻倍来摆脱“goodjob”的双引号:

 ="./command.sh -id "&A2&" -amount "&B2&" -assignment "&C2&" -reason ""goodjob"""