公式里怎么使用IF條件語句?
作者:金字塔 來源:cxh99.com 發布時間:2017年09月25日
-
咨詢內容:
我新建了一個公式
較大值:if c>ref(c,1) then c else ref(c,1);
公式測評提示“
then語句前缺少
if
”
我試了下面這樣可以通過測試
if c>ref(c,1)?
then
較大值1:c;?
else?
較大值2:ref(c,1);
可是這樣寫會提示變量名“
較大值
”重復
if c>ref(c,1)?
then
較大值:c;?
else?
較大值:ref(c,1);
?
-
金字塔客服:
:是聲明和賦值變量,所以你會提示你重復定義變量。
你可以自己:=代替,表示賦值
?
較大值:if c>ref(c,1) then c else ref(c,1);
這一種就是語法錯誤。