At some point during 2021, my income ended up exceeding the limit to directly contribute to a Roth IRA, which was unexpected. At that time, I had already contributed an amount below the limit (let's say $4000 of a $6000 limit). I recharacterized all $4000 to a traditional IRA, which required calculating Net Income Attributable (NIA), or gains on that $4000 since making the contribution. Let's say the NIA was $500. Later, I also contributed $2000 directly to the new traditional IRA I had.
Does the $500 in NIA count toward my total contributions? In the scenario above, would my total contributions for 2021 be $6000 or $6500?
I am located in the USA.