I want to look for the nearest exp date 'Cell G" and quantity 'Cell H' from the left data. With refer to the sample screenshot,
to fine the nearest exp date: I using xlookup to return earliest date by matching with the material. Return value 04-Mar-22.
to find the nearest exp quantity: if using xlookup will only return the first quantity which is 7. But, actually there are two line with same batch D261205L and same exp date 04-Mar-22, is there any formula can get the result of adding that two quantity?

