Resumen: The objective of this paper is to analyze the imitation behavior of investors in especially convulsed periods, such as the 2008 financial crisis and the recent global pandemic, both of which could affect investors'' emotions and behavior, although both have different characteristics and might have different implications. The cross-sectional dispersion of returns is used to measure the level of herding in the markets of Spain and Portugal, using a survivorship-bias-free dataset of daily stock returns during the period January 2000–May 2021, in turn divided into several sub-periods classified as pre-2008 crisis, 2008 crisis, post-2008 crisis, Covid-19 and post Covid-19. Additionally, the existence is studied of differences between days of positive and negative returns, or between days of high volatility compared to the rest, and whether the cross-sectional dispersion of returns in one market is affected by the cross-sectional dispersion of returns in the other market. The results indicate that herding appears with greater intensity in periods prior to the crisis, disappearing during the financial crisis and reappearing, although with less intensity, after it, while it is not generally detected in Covid-19 times. However, herding behavior can be observed in the market during the pandemic on high volatility days. Idioma: Inglés DOI: 10.1016/j.najef.2021.101531 Año: 2021 Publicado en: NORTH AMERICAN JOURNAL OF ECONOMICS AND FINANCE 58 (2021), 101531 [19 pp.] ISSN: 1062-9408 Factor impacto JCR: 3.136 (2021) Categ. JCR: BUSINESS, FINANCE rank: 44 / 111 = 0.396 (2021) - Q2 - T2 Categ. JCR: ECONOMICS rank: 117 / 382 = 0.306 (2021) - Q2 - T1 Factor impacto CITESCORE: 3.7 - Economics, Econometrics and Finance (Q1)