The purpose of the present invention is to provide a condensed heterocyclic compound having a RORgammat inhibitory activity. A compound represented by formula (I') [wherein each symbol is as defined in the description] (wherein 2-(2-((4-cyanophenyl)amino)-2-oxoethoxy)-N-(9-ethyl-9H-carbazol-3-yl)acetamide and N-(4-cyanophenyl)-N'-(9-ethyl-9H-carbazol-3-yl)-3-methylpentanediamide are excluded) or a salt thereof.