Check IDs in a list against one ID

Hi folks

I want to be able check a list of IDs against one ID, specifically if all the IDs match the one ID, then yes, otherwise no. So, for example, a sales rep has an ID of 1234 - I want to know: do the sales rep IDs for the last 10 sales all match that one ID. Just to be clear, this is not just “are all the IDs identical” - I need to specifically check whether or not they all match any given ID. Ideally, this would be a custom dimension

Many thanks in advance