Retirement tax questions

Re reading your post, I think I assumed that "in January" was January 2017.   Now I think you meant January 2018 *for* 2017.

If that is the case, then it would seem that Vanguard did treat the contribution made *in* 2017  that you wanted to apply to 2016 as a 2017 contribution instead, so no 2016 contribution was posted at all.   That would be consistent with the code N.

Again, if that is what happened, then that would make the January 2018 contribution *for* 2017 an excess 2017 contribution, unless Vanguard  also posted that as a *2018* contribution instead of a 2017 contribution.
**Disclaimer: This post is for discussion purposes only and is NOT tax advice. The author takes no responsibility for the accuracy of any information in this post.**