I have this sheet :
Formula A1 :
=text(today(), "DD MM YYYY")
Formula B1 :
=text(today(), "DD MMM YYYY")
Formula A4 (check if A1 = A2) :
=A1=A2
Formula B4 (check if B1 = B2) :
=B1=B2
I have a 'copy' button on the right and assign my custom function to copy from A1 to A2 and B1 to B2 :
function copy() {
Sheet = SpreadsheetApp.getActiveSheet()
var val = Sheet.getRange("A1").getValue()
Sheet.getRange("A2").setValue(val)
var val = Sheet.getRange("B1").getValue()
Sheet.getRange("B2").setValue(val)
}
The image above showing the result after I run the script. They look the exactly the same. but the B4 showing FALSE. What is wrong ?
I also tried to use 2 different names and change 'var' to 'const' :
function copy() {
Sheet = SpreadsheetApp.getActiveSheet()
const val = Sheet.getRange("A1").getValue()
Sheet.getRange("A2").setValue(val)
const val2 = Sheet.getRange("B1").getValue()
Sheet.getRange("B2").setValue(val2)
}