Hi, I'm looking for assistance how I can assign unique ID’s based on an order by distance miles. Below is an example what I’m trying to accomplish under column E (New ID).

My goal is to extract the 4 nearest employees by distance miles then extract the nearest 3 stores by employee. Below is my end goal.
I appreciate any guidance. Thanks in advance.
