Temporarily return 'Text.From(daysDiffSPLY)' instead of the first null and you'll understand: You are comparing daysDiffSPLY and not daysDiffTY so you should compare it to [0, 6], [7, 34], ... instead of [365, 371], [372, 399], etc.