Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google sheets Google sheets将月份作为数字转换为月份名称_Google Sheets_Google Sheets Formula - Fatal编程技术网

Google sheets Google sheets将月份作为数字转换为月份名称

Google sheets Google sheets将月份作为数字转换为月份名称,google-sheets,google-sheets-formula,Google Sheets,Google Sheets Formula,我有一个A2号牢房,日期时间像 30.11.2020 14:35:54 我需要把它转换成MMMM-YYYY 2020年11月 然后使用此值重命名图纸 我在另一个单元格B2中尝试了MONTH函数: =MONTH(A2)&"."&YEAR(A2) 它回来了 11.2020 然后我在脚本中使用B2的值来重命名当前工作表 function onEdit(e) { if(e.range.getA1Notation() !== 'B2') return; var

我有一个A2号牢房,日期时间像

30.11.2020 14:35:54

我需要把它转换成MMMM-YYYY

2020年11月

然后使用此值重命名图纸

我在另一个单元格B2中尝试了MONTH函数:

=MONTH(A2)&"."&YEAR(A2)
它回来了

11.2020

然后我在脚本中使用B2的值来重命名当前工作表

function onEdit(e) {
if(e.range.getA1Notation() !== 'B2') return;
    var s = e.source.getActiveSheet()
            s.setName(s.getRange('B2')
                .getValue())
}
我做的另一个尝试是使用DATE函数,它在单元格中看起来不错,但是sheet name看起来像

2020年11月30日星期一14:35:54 GMT+0300(东非时间)

但我不知道如何将月号转换为月名

有什么想法吗?

试试这样:

=TEXT(A2; "mmmm yyyy")

非常感谢它的工作