I just created my first ever archer squad. The captain of the guard is the leader if this one (apparently). I've set their uniform to archer. I've made a second barracks/training room/archery range
But I have two issues. In the job menu, over half of them say "Soldier (unable to work)".
And only my captain of the guard has managed to fire a bolt at the target.
Note there is currently a bug (still present in my last 31.18 game, last time I played) that prevents marksdwarves from using bolts that have been hauled to a stockpile, or placed in a bin. (some people report that they use bolts that are not in bins). In my last game, if a bolt has ever been touched by a civilian hauler, it seems it has been forever marked for civilian use, and the military will never touch it.
A workaround I use in my games is to never ever designate ammo stockpiles, rather I let the marksdwarves pick up bone bolts straight from the craftsdwarf workshop. So my archer tower has a craftsdwarf workshop and a forge on the floor below, and I only use those two workshop to make bolts.
Also, only one marksdwarf can use one archery range at a time, so I built multiple long, narrow rooms with targets at the ends, and designate each as a separate range (remember to enable 'T'raining for the squad on all of them). 3 ranges=3 marksdwarves training at a time. If you designate one range with 3 targets, only one marksdwarf will train at a time, and two targets will be unused.