What's the difference between using either for or in in the following examples?
- Bill hasn't taken a vacation for/in two years.
- Jack hasn't been to school for/in four days.
- I hadn't seen Mary for/in three weeks when she finally decided to show up.
There is no difference in grammaticality. All 3 sentences are grammatical, with either for or in.
There is no difference in meaning. All 3 sentences describe the same situation, with either for or in.
However, there is one difference in syntactic affordances. In with an indefinite durative temporal phrase (in weeks, in two days, in donkey's years, in a long time, etc.) is a Negative Polarity Item.
I.e, in two days is restricted to negative contexts, while for two days has no such restriction.
Notice that all the examples above are negative. Remove the -n't to see the difference.
For works fine, though the sentences don't mean the same thing.
- Bill has taken a vacation for two years. (a very long vacation)
- Jack has been to school for four days. (there were four daily attendances)
- I had seen Mary for three weeks. (indicates frequent or continuous contact)
But all the ones with in are ungrammatical, and have no discernible meaning.
Grammarians mark ungrammatical sentences with an asterisk:
- *Jack has been to school in four days.
- *Bill has taken a vacation in two years.
- *I had seen Mary in three weeks.
In other words, in negative sentences, there are two ways to refer to duration, with in or with for.
Outside a negative context, the system doesn't work the same way. Negation is very complex.