答案1
公式
=LET(
_start, $G$1, _days, $G$2,
_text, {"Date","Time","Meal","Food Served"},
_meals, {"Breakfast","Snack","Lunch","Snack","Dinner","Snack"},
_col1, TEXTSPLIT(TEXTJOIN(",",FALSE, INDEX(_text, 1)&","&
(LAMBDA(x, SUBSTITUTE(REPT(TEXT(_start+x,"mm/dd/yyyy")&",",
COUNTA(_meals))&",",",,",""))(SEQUENCE(_days,1,0,1)))),,","),
_rows, _days*(COUNTA(_meals)+1),
_col2, TEXTSPLIT(SUBSTITUTE(REPT(INDEX(_text,2)&REPT(",",COUNTA(_meals)+1),_days)&";",",;",""),,",",FALSE),
_col3, TEXTSPLIT(SUBSTITUTE(REPT(TEXTJOIN(",",TRUE, INDEX(_text, 3),_meals)&",",_days)&",",",,",""),";",",",FALSE),
_col4, TEXTSPLIT(SUBSTITUTE(REPT(INDEX(_text,4)&REPT(",",COUNTA(_meals)+1),_days)&";",",;",""),,",",FALSE),
HSTACK( _col1, _col2,_col3,_col4 )
)
# of Days set to: 6
# of Days set to: 3
Conditional Formatting: Rules
Conditional Formatting: Custom Formula for Headings Rows
Conditional Formatting: Custom Formula Non-Headings Rows