Note, for the LOOKUP to work, you need to make sure that the first array, {d1,d2,d3,d4,d5,d6,d7} is in ascending order.... and the second range must be correspondent to the values in the first range.