Making excel sheets according to unique id.

Have a look at https://forum.posit.co/t/creating-a-list-of-data-frames-and-then-assigning-group-names/130882 and the link I gave in that thread.