Due to lack of time I didn't automate it completely. Its combination of Manual Steps and Automation(VBA code) which is time consuming as of now. To make it simple for you I converted the whole process into a Single Custom Sql.
This is Input format to tableau.
and this is output format. No manual data preparation needed now. Further you can also change the within distance limit as you want instead of 20.