You're using a complex Excel formula with LET, FILTER, MAP, and other dynamic array functions. Let's break it down and identify why it might be producing an error.
✅ Formula Overview
=LET(
EndTime, BQ59,
SubPalOPStart, MINIFS($BO$6:$BO$195, $BO$6:$BO$195, ">="&BQ59, $BO$6:$BO$195, "<>"&BO59, $BF$6#, BF59, $BM$6#, BM59),
BreakFilter, IF(BJ59="Both", TRUE, (Break_Resource=BJ59)+(Break_Resource="Both")) * (Break_Ends>=EndTime) * (Break_Starts<=SubPalOPStart),
BreakStarts, FILTER(Break_Starts, BreakFilter, 0),
BreakEnds, FILTER(Break_Ends, BreakFilter, 0),
SumBreaks, MAP(
FILTER(Break_Starts, BreakFilter, 0),
FILTER(Break_Ends, BreakFilter, 200000),
LAMBDA(StartCode, EndCode, MIN(EndCode, SubPalOPStart) - MAX(StartCode, EndTime))
),
SumBreaks
)
🔍 Step-by-Step Debugging
1. MINIFS Syntax
SubPalOPStart, MINIFS($BO$6:$BO$195, $BO$6:$BO$195, ">="&BQ59, $BO$6:$BO$195, "<>"&BO59, $BF$6#, BF59, $BM$6#, BM59)
- You are using dynamic arrays (BF6# and BM6#) as criteria ranges.
- MINIFS requires that all criteria ranges be the same size as the min_range.
- If BF6# or 6# are not the same size as 6:195, this will cause a #VALUE! error.