I am trying to find the right code to determine FIFO order based on criteria involving the values in three different cells of any given row. I have a column (A) containing many different 9 digit item numbers, a column (G) which is a location type, and a column (J) that contains expiration dates that occur in the future.
First, I only want to compare rows that have the exact same value in column A. (There will be frequent occasions in which the value in cell A ,A2 for example, is exactly the same as the value in cells A3 through A15)
Next, I want to determine which of the rows containing the exact same value in A, contains the expire date in J that occurs first. (Many rows will share the value in column A, and some will share the same date value in column J. If there are duplicate date values in column J, any one of the dates occuring soonest has to meet the criteria for the value in column G.)
Finally, I want to establish whether or not the row, or any one of rows with the expire date occuring soonest is in the desired location. (There are only two different location values, PICK or RESERVE)
I have attached a small example of what the data looks like at the point I need to place this code into a larger macro.