我用记事本++。我发现这是我能找到的最好的解决方案。对于任何感兴趣的人,这是我的最终公式……有点乱。这是我为了好玩/体验/其他什么而做的一个按小时计费的电子表格。
=if(
row()>=($J$4+2)
, ""
, if(
row() = 2
, if(
or(
MID(TEXT(datevalue($J$3), "ddEE"),3,9) = "Sat"
, MID(TEXT(datevalue($J$3), "ddEE"),3,9) = "Sun"
)
, if (
MID(TEXT(datevalue($J$3), "ddEE"),3,9) = "Sat"
, if (
$J$8="No"
, if (
$J$9="No"
, MID(TEXT(datevalue($J$3)+2, "ddEE"),3,9)&" - "&datevalue($J$3)+2
, MID(TEXT(datevalue($J$3)+1, "ddEE"),3,9)&" - "&datevalue($J$3)+1
)
, MID(TEXT(datevalue($J$3), "ddEE"),3,9)&" - "&datevalue($J$3)
)
, if (
$J$9="No"
, MID(TEXT(datevalue($J$3)+1, "ddEE"),3,9)&" - "&datevalue($J$3)+1
, MID(TEXT(datevalue($J$3), "ddEE"),3,9)&" - "&datevalue($J$3)
)
)
, MID(TEXT(datevalue($J$3), "ddEE"),3,9)&" - "&datevalue($J$3)
)
, if(
or(
isnumber(
search(
"Sat",A1
)
)
,isnumber(
search(
"Fri"
, A1
)
)
)
,if(
isnumber(
search(
"Sat"
, A1
)
)
,if(
$J$9="No"
, MID(TEXT(datevalue(right(A1,len(A1)-5))+2, "ddEE"),3,9)&" - "&datevalue(right(A1,len(A1)-5))+2
, MID(TEXT(datevalue(right(A1,len(A1)-5))+1, "ddEE"),3,9)&" - "&datevalue(right(A1,len(A1)-5))+1)
, if(
isnumber(
search(
"Fri"
, A1
)
),
if (
$J$8="No"
, if (
$J$9="No"
, MID(TEXT(datevalue(right(A1,len(A1)-5))+3, "ddEE"),3,9)&" - "&datevalue(right(A1,len(A1)-5))+3
, MID(TEXT(datevalue(right(A1,len(A1)-5))+2, "ddEE"),3,9)&" - "&datevalue(right(A1,len(A1)-5))+2
)
, MID(TEXT(datevalue(right(A1,len(A1)-5))+1, "ddEE"),3,9)&" - "&datevalue(right(A1,len(A1)-5))+1
),
)
)
, MID(TEXT(datevalue(right(A1,len(A1)-5))+1, "ddEE"),3,9)&" - "&datevalue(right(A1,len(A1)-5))+1
)
)
)