Forum Discussion
JTrehus
Feb 02, 2022Copper Contributor
Excel formula - Show value in dedicated cell based on various values in multiple cells.
Hi, I would like to get some help with finding a correct formula for the following cases. Case #1 If text in A3 shows 'Monday' i would like to get the autosum of D3-C3 visible at E3. ...
- Feb 03, 2022
See the attached sample workbook. I used a list of public holidays in The Netherlands; you can edit the list as needed.
PeterBartholomew1
Feb 04, 2022Silver Contributor
It may be possible but it won't be trivial. Using 365 insider beta my formula was
= MAKEARRAY(2,4,
LAMBDA(d,shift,
LET(
s, INDEX(Start,d),
e, INDEX(End,d),
wd, IF(WEEKDAY(INDEX(Date,d))=1,1,2),
shiftS, INDEX(bandS,wd,shift),
shiftE, INDEX(bandE,wd,shift),
laterStart, IF(s<shiftS, shiftS, s),
earlierEnd, IF(e<shiftE,e,shiftE),
hrs, earlierEnd - laterStart,
IF(hrs>0, hrs, 0)
)
)
)
I have used a Lambda helper function to produce all the results as a single formula but, using traditional Excel, it should be possible to pick the references out as relative references for each cell. The Let would need to be replaced by a nested formula but that is not my scene.
- JTrehusFeb 04, 2022Copper ContributorHi,
Thanks for your reply.
Greetings Jeroen