Electron counting is an important concept that often governs properties such as stability of molecules, clusters, and complexes. Here we explore silver clusters doped with a transition-metal atom, where the behavior of d electrons has been an issue, i.e., whether or not they delocalize to participate in electron counting. The present study is performed on cations and anions of AgNM+/− (M = Sc–Ni) clusters to examine their stability through reaction with oxygen, which enables systematic control of the number of valence electrons in the system by the cluster size, the charge state, and the transition-metal element across the periodic table. Among 18-valence-electron clusters, both cations and anions exhibit exceptional stability upon Sc, Ti, and V doping, whereas only cations upon Fe, Co, and Ni doping; i.e., Ag16Sc+, Ag15Ti+, Ag14V+, Ag14Sc−, Ag13Ti−, Ag12V−, Ag11Fe+, Ag10Co+, and Ag9Ni+ are identified as magic clusters. The exceptional stability is attributed to electronic-shell closure with the 18 valence electrons, where 3d electrons are delocalized to contribute to electron counting. In contrast, Ag9Fe−, Ag8Co−, and Ag7Ni− are highly reactive even though they possess 18 valence electrons. Analysis of reaction products along with DFT calculations reveals that the transition-metal atom is endohedrally doped in the former magic clusters, whereas the doping is exohedral in the latter reactive species. It is thus found that an endohedral geometry plays a key role in delocalizing 3d electrons to participate in electron counting. Note that, upon Cr and Mn doping, the half-filled nature forces their 3d electrons to be localized both in endohedral Ag13Cr+ and Ag12Mn+ and in exohedral Ag11Cr− and Ag10Mn−.