"IF(LEN(C39)<1,"N/A",LOOKUP(MAX(1,OFFSET(Truck 1::$A$1,3,1,1,MATCH(J1,Truck 1::A2:AH2,0)−2)),Truck 1::A4:AH4,Truck 1::A14:AH14))"
Parsing this:
IF(LEN(C39)<1,"N/A",LOOKUP(MAX(1,OFFSET(Truck 1::$A$1,3,1,1,MATCH(J1,Truck 1::A2:AH2,0)−2)),Truck 1::A4:AH4,Truck 1::A14:AH14))
Tests C39 for content. If none, returns N/A. Otherwise executes LOOKUP.
LOOKUP(MAX(1,OFFSET(Truck 1::$A$1,3,1,1,MATCH(J1,Truck 1::A2:AH2,0)−2)),Truck 1::A4:AH4,Truck 1::A14:AH14)
Match reads the value in J1 of 'this table'. Searches for this value in columns A to AH of row 2 of Truck 1, accepting only an exact match, and returns a number equivalent to the position in the list of this value.
-2 subtracts 2 from this number, and the result is returned to OFFSET as its fifth argument.
For 'this table' = Day 4, MATCH will return 7 (4-Apr is fourth in the list, which includes the word Date in column A, and the two empty positions in columns B and C), -2 will make that 5, and 5 will be returned to OFFSET.)
LOOKUP(MAX(1,OFFSET(Truck 1::$A$1,3,1,1,5)),Truck 1::A4:AH4,Truck 1::A14:AH14)
OFFSET(base, row-offset, column-offset, rows, columns)
base is cell A1 of Truck 1. From here, the formula says go down 3 rows (to row 4), right 1 column (to column B),get the values for one row and five columns (B4, C4, D4, E4 and F4). OFFSET returns this list of five values (0,0,21650, 21722,0) to MAX.
LOOKUP(MAX(1,0,0,21650,21722,0),Truck 1::A4:AH4,Truck 1::A14:AH14)
MAX extracts the largest value in that list (21722) and returns it to LOOKUP. (I don't see an obvious reason for the 1 at the beginning of the list. It's in the formula as a fixed value, before OFFSET.)
LOOKUP(21722,Truck 1::A4:AH4,Truck 1::A14:AH14)
LOOKUP takes the value provided by MAX (21722) and looks for it in columna A to AH of row 4 (!?!). Although it will not find that value, it will find a 'close-match', the 3 (the largest value in the row less than or equal to the search value) in the column for 6-Aug, and will return the value from row 14 of the same column (21800).
But the LOOKUP part of this formula is redundant. MAX has already returned the value you want in the previous step. Edit your formula to remove the LOOKUP part, and it should provide correct results:
=IF(LEN(C39)<1,"N/A",MAX(1,OFFSET(Truck 1::$A$1,3,1,1,MATCH(J1,Truck 1::A2:AH2,0)−2)))
Regards,
Barry