Magnetic semiconductors have attracted a lot of attention by having both electronic charge and spin degrees of freedom. In this paper, we obtained twenty magnetic semiconductors such as FeVLaSb, FeVPrSb, FeCrTbSi, CoVDySi, and CoVHoSi by adding lanthanides to quaternary Heusler compounds based on the Slater-Pauling law and orbital hybridization theory. The relationship between the lattice constants and energy gaps of the magnetic semiconductors with lanthanide elements is investigated by in-depth analysis. These magnetic semiconductors of quaternary Heusler compounds promising candidates to find applications as spin filtering materials in spintronics devices.