jsã®eval()
é¢æ°ãGoogleã¹ãã¬ããã·ã¼ãã§ã使ããã
ã§ãã¹ãã¬ããã·ã¼ãé¢æ°ãããªãã®ã§ãã»ã«ã«ç´æ¥=eval(A1)
ã¨ãå
¥ãã¦ããä¸æãªé¢æ°ãã«ãªãããã以ä¸ã®ããã«GASã§ä¸æ¦ã©ãããã¦ããã
function my_eval(formula) {
 return eval(formula);
}
ããã§
- A1ã»ã«ã«
5 + (-3)
- A2ã»ã«ã«
=my_eval(A1)
ã¨å
¥åããã¨ãA2ã»ã«ã«2
ãå
¥ãã¯ãã
ã§ã¾ããeval()
ãªã®ã§ã»ãã¥ãªãã£çã«å±ãªããããããGoogleã¹ãã¬ããã·ã¼ãã§ä½¿ã£ãã¨ãã®å
·ä½çãªãªã¹ã¯ã·ããªãªãã¡ãã£ã¨æãæµ®ãã°ãªãã
ã¯ã©ã¦ãã§ã©ããªã¤ã³ã¸ã§ã¯ã·ã§ã³ãããããåé¡ãªãæ°ããããã ãã©ãä»ã®éå
¬éã®ã·ã¼ããå
¬éããããã§ãããªã確ãã«ã¤ãããªãã§ãã¾eval使ã£ãã·ã¼ãèªä½ãéå
¬éãªãæ¹å¤ãããªãããç´æ¥ä½¿ãã¶ãã«ã¯åé¡ãªãã¯ãã
Googleã¹ãã¬ããã·ã¼ãã«ã¯Excelã®ãæ¬å½ã«éãã¦ãããã§ããï¼ãçãªã®ããªãããå±ãªãã£ã¡ãå±ãªããã©ãå
輪ã§ä½¿ãåã«ã¯åé¡ãªãããã
ãã¼ã«ã«ç·¨éå¯è½ãªã·ã¼ããã¤ããã¨ãããªã
ã ã¨ããã¨ãGoogleã¹ãã¬ããã·ã¼ããããã¼ãã¼ãå±¥æ´ãåå¾ãã¦éä¿¡ããããã¤ãã¤ã³ã¹ãã¼ã«ã¨ãã§ãããã ãããã
ãããªãããããããªããã°ããã ãã
ãã¼ããã»ãã¥ãªãã£ã¯é£ãããªã