|
楼主 |
发表于 2021-8-27 14:54
|
显示全部楼层
大佬大佬,我试着改了下(之前你好像没把23:00 - 06:00 这段时间做进去)
然后就有个地方一直报错
(VBA写多了,所以公式也改成VBA代码的格式,应该不会有影响吧?)
= Table.SplitColumn(Table.AddColumn(#"Reordered Columns1", "Workday Time",
each If [#"Holiday"] <> null Then
{"Holiday","0:00 - 24:00"}
else let d=Date.DayOfWeek([Date]) in
If d < 5 Then
If Time.Hour([in]) >= 6 && Time.Hour([in]) < 18 Then
{"Mon to Fri","6:00 - 18:00"}
Else
If Time.Hour([in]) >= 18 && Time.Hour([in]) < 23 Then
{"Mon to Fri","18:00 - 23:00"}
Else
{"Mon to Fri","23:00 - 6:00"}
Else
If d = 6 Then
if Time.Hour([in]) >= 6 && Time.Hour([in]) < 23 Then
{"Sat","6:00 - 23:00"}
Else
{"Sat","23:00 - 6:00"}
Else
if Time.Hour([in]) >= 6 && Time.Hour([in]) < 23 Then
{"Sun","6:00 - 23:00"}
Else
{"Sun","23:00 - 6:00"}),"Workday Time",each _ ,{"Workday Period","Time Period"}) |
|