Forum Discussion
Vineeth_Surendran
Feb 07, 2022Copper Contributor
Date format convert to number formate
I want to convert date to number format., I tried several ways but i can’t convert it Eg:- Date 12-12-2021 i need to covert this date to numbers, like 12122021 I used custom format but i can’t copy ...
Patrick2788
Sep 08, 2024Silver Contributor
You're receiving the #CALC! error because BYROW is designed to return a scalar for each row - 7 rows, 7 scalars.
One approach is to use thunks. For example,
=LET(
i, SEQUENCE(ROWS(Table2)),
thunk, LAMBDA(x, LAMBDA(x)),
thunks, BYROW(
Table2[Begin],
LAMBDA(x,
LET(
StartDag, x,
EindDag, OFFSET(x, , 1),
AantalUur, OFFSET(x, , 2),
NettoWerkdagen, NETWORKDAYS(StartDag, EindDag),
LijstWerkdagen, WORKDAY(StartDag - 1, SEQUENCE(NettoWerkdagen)),
UurPerDag, AantalUur / NettoWerkdagen,
thunk(
HSTACK(
LijstWerkdagen,
EXPAND(UurPerDag, NettoWerkdagen, , UurPerDag)
)
)
)
)
),
DROP(REDUCE("", i, LAMBDA(acc, v, VSTACK(acc, INDEX(thunks, v, 1)()))), 1)
)
There are several discussions in this forum that cover thunks thoroughly. This site is a good primer for getting started:
What is a thunk in an Excel lambda function? - FLEX YOUR DATA