Using Google Sheets scripts, why does my if statement always return false when comparing cell values?

后端 未结 2 948
我寻月下人不归
我寻月下人不归 2021-01-15 14:41

I need to compare two cell values and act on them if they are different. My \"if\" statement always returns false when comparing the cell contents however, and I can\'t figu

2条回答
  •  迷失自我
    2021-01-15 15:07

    The following line of code is incorrect, below it is corrected.

      var testvalue1 = testvalues[0][0]; // The contents from A1
      var testvalue2 = testvalues[1][0]; // The contents from A2
    

    You are originally grabbing the entire row instead of a single cell.

提交回复
热议问题