There seems to be a discrepency in the account of the years of famine in Parshas vaYigash. Yosef relates to his brothers that there are 5 years of famine still to come after their arrival until the predicted 7 years of famine would be complete. Yet, we find that at the end of the second year of famine the people sold their land in exchange for seed to plant, implying that that famine was drawing to a close. Were there 7 years of famine or not?
The Ibn Ezra sees no contradiction here. People might still have planted during the famine, as even in the leanest years perhaps some crops grew, or perhaps even withint he 7 bad years there were some years which were better than others. Rashi (47:18), however, assumes that despite Yosef's prediction, the famine indeed did end after two years. Once Ya'akov descended to Egypt, in the special merit of his righteousness the years of famine came to an early end.
Ramban rejects Rashi's interpretation and suggests that even if one accepts the Midrashic view that Ya'akov's presence interrupted the famine, the remaining 5 years of famine still occurred after Ya'akov's death. There must have been 7 total years of famine, argues Ramban, for were that not the case it would mean that Yosef's interpretation of Pharoah's dream as predicting 7 years of famine was erroneous.
I do not understand the Ramban's question. If a prophet foretells punishment, the occurance of the prophecy is implicitly conditional on the people not repenting or not having other merit. We are all familiar with the story of Yonah who was sent to tell Ninveh that the city would be destroyed; that prophecy never came to be because the city collectively repented. Prophecy is guaranteed only if religious status quo is maintained; it does not circumscribe human free choice to change circumstance and avert a decree. Perhaps Yosef's prediction of 7 years of famine was accurate barring the unforeseen descent of his father to Egypt. However, once events conspired to bring Ya'akov to Egypt, the calculus of merit was changed and the decree was avoided. Any suggestions?
(Addendum: After posting this question on the Ramban, it dawned on me that my focus was perhaps too narrow. Yosef is completely confident that the dreams he saw while a young man will eventually be fulfilled even years later, without any doubt that circumstances of the intervening years may negate or modify his predictions. True, according to Rashi when the brothers first came down to Egypt and bowed before Yosef this was a fulfillment of the first dream and led Yosef to conspire to complete the prophecy by bringing the second dream to fulfillment, but the fact remains that Ramban among others disagrees with Rashi's assumption that any aspect of the dreams was fulfilled before Ya'akov's arrival, and the assumption that because one dream is fulfilled the other must naturally follow seems to take much for granted.)