Hi Zeddie,

Let me give you three ways.

(1) VLOOKUP: Because your Sequence Begin is in ascending sequence then you can use VLOOKUP with an approximate match to retrieve a Sequence End and if that is equal or greater than the Payment Number then use another VLOOKUP to retrieve the Code.

(2) INDEX & MATCH: Basically the same approach as VLOOKUP and requires Sequence Begin to be in ascending sequence. INDEX & MATCH are often a better approach as they let you do more, e.g. they could retrieve Code if it was in a column left of Sequence Begin.

(3) AGGREGATE: This works if Sequence Begin is not in order as it looks down every row and retrieves the first one that satisfies the criteria, that Payment Number is between Sequence Begin and Sequence End.