Google Spreadsheets中一个月的最后一天和第一天

mik*_*789 5 formula worksheet-function google-sheets

在Google电子表格中获取上个月的第一天和上个月的最后一天的方法是什么?我尝试了几种方法来解决这个问题但没有成功.

Zyg*_*ygD 15

如果您有基准日期A1,
则以下公式适用于上个月第一天:

=date(year(A1),month(A1)-1,1)
Run Code Online (Sandbox Code Playgroud)

找到上个月最后一天更简单:

=eomonth(A1,-1)
Run Code Online (Sandbox Code Playgroud)


Ric*_*ard 5

上个月的最后一天(国际)

=eomonth(now();-1)
Run Code Online (Sandbox Code Playgroud)

上个月的最后一天(美国)

 =eomonth(now(),-1)
Run Code Online (Sandbox Code Playgroud)

上个月的第一天(国际)

=eomonth(now();-2)+1
Run Code Online (Sandbox Code Playgroud)

上个月的第一天(美国)

    =eomonth(now(),-2)+1
Run Code Online (Sandbox Code Playgroud)

演示:

在此处输入图片说明