Brief Summary:
The commentators almost all agree that the four hundred years was not the time spent in Egypt. Rather, the four hundred years is from an earlier time (with some disagreements as to what that time is). Most of the commentators agree that the actual time spent in Egypt was two hundred and ten years. Other possibilities suggested are two hundred and twenty five years, two hundred and twenty seven years, two hundred and forty years, and two hundred and seventy years, with the outlier view that the entire time mentioned was indeed spent in Egypt itself.
Important Scriptural Facts:
The Actual Answer:
The question of the length of the exile was taken up by virtually every commentator. Most of them, e.g. Rashi (commentary to Exodus 12:40), Rashbam (commentary to Exodus 12:40), Bechor Shor (commentary to Exodus 12:40 one approach), et al, assume that the four hundred years prophesied to Abraham were from Isaac's birth while the four hundred and thirty years mentioned in Exodus 12:40 were from the time of the prophecy. Thus, the prophecy occurred thirty years before Isaac's birth, when Abraham was seventy. The actual amount of time spent in Egypt was only two hundred and ten years, according to the Sages; this can be calculated by starting with four hundred and subtracting the sixty years for Isaac's age at Jacob's birth and subtracting one hundred and thirty years for Jacob's age when he entered Egypt. 400 - 60 - 130 = 210. And of course, as noted in the question, it is impossible to reach four hundred years with just the generations of Kehat, Amram, and Moses.
This approach is also justified by the claim in Bava Batra 119b (translation) that Jocheved was born when they entered Egypt, was one hundred and thirty years old when she gave birth to Moses, and Moses was eighty years old when they left Egypt (130 + 80 = 210).
The most glaring issue with this theory is that it requires the prophecy at the Covenant Between the Parts to have occurred when Abraham was seventy years old. Yet the text in Genesis 12:4 explicitly states that Abraham was seventy five years old when he left Haran. In order to avoid this issue, many of the commentaries adopt the idea in Seder Olam (Chapter One), that Abraham was seventy at the time of the prophecy but then returned to Haran for five years (until he was seventy five) and then came back to Canaan, and the verse is saying that he was seventy five when he left Haran for the last time.
Radak (commentary to Genesis 15:13) instead modifies the four hundred and thirty years to have started five years before the prophecy, when Abraham was first told to go to Canaan. This is also Bechor Shor's "peshat" approach (commentary to Exodus 12:40), and R. Elijah of Vilna adopts a similar approach in his commentary to Seder Olam .
Another issue that most of these commentaries do not address, is why the Torah uses two different calculations.
A different variation of this is offered by R. Chananel (commentary to Exodus 12:40) and R. Bachye Ben Asher (commentary to Exodus 12:40). They argue that the four hundred and thirty years starts from Isaac's birth, and the four hundred years starts from the beginning of the hardships of Abraham's progeny and that the three different figures were based on merit. However, this would mean that the four hundred years began when Isaac was thirty years old, but they don't identify anything significant that happened then. Using this calculation, the actual time in Egypt would have been two hundred and forty years (430 - 60 - 130 = 240).
Ramban (commentary to Exodus 12:40) suggests that both calculations are referring to the same time period, which was four hundred and thirty years. However, God did not bother to specify the additional thirty years to Abraham, and simply told him the imprecise number of four hundred years.
ודעתי בדרך הפשט כי י"י אמר לאברהם ידוע תדע כי טרם תתי לך הארץ הזאת גר יהיה זרעך בארץ לא להם ימים רבים ארבע מאות שנה ולא חשש להודיע השלשים כי אמר לו עוד ודור רביעי ישובו הנה להודיעו שלא ישובו מיד בסוף ארבע מאות עד הדור הרביעי שיהיה שלם עון האמורי ירמוז לשלשים שנה הללו כי עמדם במדבר ארבעים שנה לא מפני עון האמורי שלא נשלם
In line with the plain meaning of Scripture, it is my opinion that G-d said to Abraham, "Know of a surety that before I give you this land, thy seed shall be a stranger in a land that is not theirs for a long time — four hundred years." He did not care to mention the additional thirty years to him [i.e., Abraham], because He told him further on, and in the fourth generation they shall come back hither, thereby informing him that they will not come back immediately at the end of four hundred years until the fourth generation when the sin of the Amorite will be full. (Chavel translation)
Then (commentary to Exodus 12:42) Ramban calculates the actual time in Egypt as being somewhat more than two hundred and ten years:
והנכון שיאמר כי גר יהיה זרעך בארץ לא להם ארבע מאות שנה מן היום הזה והענין לאמר לו לא ינחלו בניך הארץ הזאת אשר אני נותן להם מיד אבל יהיו גרים כמוך בארץ לא להם ארבע מאות שנה ועוד לא ישובו הנה עד הדור הרביעי למלאת ארבע מאות ושלשים ואם כן תהיה עמידתם במצרים כמו מאתים ועשרים שנה או קרוב לזה ואם יהיה חשבון של אותיות רד"ו שמה מסורת בישראל יתכן שירמוז ליורדים עצמם שאחרי מות יעקב יעמדו הם שם מאתים ועשר שנים ועם י"ז יהיו רכ"ז
The correct interpretation is that He was saying to Abraham "that thy seed shall be a stranger in a land that is not theirs... four hundred years from this day on." The purport thereof was to tell him: "your children will not immediately inherit this land which I give them, but instead they will be strangers like you were, in a land not theirs [for a period of] four hundred years and more. They will not return here till the fourth generation when four hundred and thirty years will be completed." But if so, then their stay in Egypt lasted about two hundred and twenty years or thereabouts. Now if the numerical value of the word 'r'du' (get you down) thither, [which is two hundred and ten], be an established tradition in Israel, it is possible that [Jacob, by using the word r'du], alluded to those who arrived in Egypt that after Jacob's death they would stay there two hundred and ten years. With the seventeen years that Jacob lived in the land of Egypt, their stay altogether totalled two hundred and twenty-seven years. (Chavel translation)
Later (commentary to Exodus 12:42) Ramban offers what he considers the best interpretation, namely, that the amount of years was extended from what was prophesied, due to the sins of the Israelites:
ועוד אני אומר כי הפשט המחוור מן הכל הוא שנאמר כי הגזרה היתה ארבע מאות שנה מן היום ההוא כאשר הזכרנו והשלשים שנה האלו הם תוספת עליהם בעון הדור ההוא כי אם נגזר על האדם בחטאו גלות וענוי שנה או שנתים והוא יוסיף על חטאתו פשע בהם יוסיפו עליו שבע על חטאתיו וגלות ויסורין כהנה וכהנה שאין ענשו הראשון הבטחה לו שלא יענש בעון שיעשה והנה היה על אברהם אבינו גזרה שיהיה זרעו גר בארץ לא להם ארבע מאות שנה ושלא ישובו הנה עד דור רביעי כי לא שלם עון האמרי ולא היתה לו הבטחה רק באחרי כן יצאו ברכוש גדול והוא מיד או מופלג כמה וגם הוא על תנאי כמו שאמר וגם את הגוי אשר יעבודו דן אנכי ואחרי כן יצאו ברכוש גדול שיעמיד בדין את הגוי אם עשו כראוי לישראל לפי מעשיהם ולפי הנגזר עליהם ועוד שאין שום הבטחה שלא יגרום החטא לבטלה אלא במקום שבועה
ומן הידוע שהיו ישראל במצרים רעים וחטאים מאד ובטלו גם המילה דכתיב וימרו בי ולא אבו לשמוע אלי איש את שקוצי עיניהם לא השליכו ואת גלולי מצרים לא עזבו ואומר לשפוך חמתי עליהם בתוך ארץ מצרים וגו' וכתיב והסירו את אלהים אשר עבדו אבותיכם בעבר הנהר ובמצרים ועבדו את ה' ועל כן ארך גלותם שלשים שנה
I maintain further that the most lucid explanation of all is that we say that the decree of the four-hundred year period, [as mentioned in Genesis 15:13], is to be reckoned from that day [of the "covenant between the parts]," as we have mentioned, and these additional thirty additional years — [in Verses 40-41 here] — were due to the sin of that generation. If exile and affliction are decreed upon a person for a year or two because of his sin and he will fully continue to add to his transgressions, exile and visitation of seven times the original magnitude will be his lot; his first punishment is no guarantee against his being punished for the additional sin he committed. Now it had been decreed upon Abraham that his children would be strangers in a land not their own [for a period of] four hundred years, and that they will not return until the fourth generation, for the iniquity of the Amorite is not yet full. Abraham was given no assurance [concerning the precise ending of the exile], except in the promise, And afterward they will come out with great substance, and that ["afterward"] could be immediately [after the four-hundred year period] or some subsequent time. Even that promise was given conditionally, as He said, And also that nation, whom they shall serve, will I judge; and afterward shall they come out with great substance, meaning that He will bring them to judgement to determine whether they did to Israel in accordance with their deeds and as was decreed upon them. Besides, no assurance is immune to to annulment because of subsequent sin unless it is accompanied by an oath. And it is a known fact that the Israelites in Egypt were wicked and exceeding sinners, having also done away with circumcision, as it is written, And they rebelled against Me, and would not hearken unto Me; they did not every man cast away the detestable things of their eyes, neither did they forsake the idols of Egypt; then I said I would pour out My fury upon them in the midst of the land of Egypt. Again it says, And put away the gods which your fathers served beyond the River, and in Egypt, and serve ye the Eternal. it was for this reason that He prolonged their exile for thirty years. (Chavel translation)
Like Ramban, Abarbanel (commentary to Exodus Chapter 12) also first mentions the possibility that the four hundred years told to Abraham was imprecise, and then suggests that it was supposed to be four hundred years but thirty years were added on due to the sins of the Israelites.
R. Joseph Ibn Kaspi (commentary to Exodus 12:40) states that the four hundred and thirty years must be a reference to the beginning of Abraham's sojourning, i.e. when he first left his birthplace. He appears to also suggest that four hundred and thirty might not actually be a precise number, and he seems to allude to the fact that the four hundred years mentioned in the prophecy are to be counted from Isaac's birth. Elsewhere (commentary to Genesis 15:13) he simply writes that R. Abraham Ibn Ezra has already explained this. In his supercommentary to Ibn Ezra's commentary to Genesis 15:13 he explains that the Israelites were only in Egypt for two hundred and ten years, and the four hundred years is from Isaac's birth.
However, Ibn Ezra's commentary to Genesis 15:13 is a bit cryptic. He writes simply "עד סוף זה הקץ מהיום" which could mean that the four hundred years start from the day of the prophecy. In his commentary to Exodus 12:40 Ibn Ezra deals with the timeline at greater length. He makes the exact argument mentioned in the question here — that by adding up the ages of Kehat, Amram, and Moses at the time of the Exodus you can't get to more than three hundred and fifty years — and concludes that the four hundred years are from Isaac's birth, while the four hundred and thirty years are from when Abraham first left his homeland at the age of seventy, five years prior to the prophecy.
It is perhaps noteworthy that the Samaritan Pentateuch and the Septuagint have a slightly different version of Exodus 12:40, in which the four hundred and thirty years are explicitly stated to include the time in Egypt and the time in Canaan. This could either be indicative of an alternate text, or it could be a "correction" in order to reconcile the timeline. Indeed, the Talmud (Megillah 9a) claims that the Sages who translated the Torah into Greek added in the words "and other lands" to this verse. This fact is noted by R. Samuel David Luzzato (commentary to Exodus 12:40) who notes that most of the later scholars agree that this was a "correction" (to reconcile the timeline) rather than a true alternate text.
Elsewhere (commentary to Exodus 6:20) Luzzato argues that the Israelites were actually in Egypt for four hundred and thirty years. He bases this on the fact that the verse in Numbers 3:28 states that there were eight thousand six hundred members of the Kehat family in the wilderness, which would be impossible if the generational sequence of Kehat > Amram > Moses is taken at face value. Rather, there must have been unnamed generations, and those generations account for the four hundred and thirty years in Egypt. He then quotes another suggestion, that the lifespans mentioned for Levi, Kehat, and Amram are actually the number of years until the families split off into separate groups. The number given for Amram is one hundred and thirty seven (Exodus 6:20), the number for Kehat is one hundred and thirty three (Exodus 6:18), and the number for Levi is one hundred and thirty seven (Exodus 6:17). If you add the seventeen years that Jacob was still alive in Egypt, you get four hundred and twenty four years (137 + 133 + 137 + 17 = 424), which is approximately the four hundred and thirty years mentioned.
Here is a quick summary of Luzzatos's view from the introduction to Daniel Klein's translation of Luzzato's commentary:
Of all the commentators to address this issue, Ralbag probably dealt with it at greatest length. He introduced several novel points. First, he criticized those who dated the four hundred years from Isaac's birth, because they had to then accept the account in Seder Olam that explained how the Covenant Between the Parts took place when Abraham was seventy. Ralbag rejects this as untenable because it is inconceivable that Abraham would have gone back to Haran after God had commanded him to go to relocate to Canaan. Furthermore, Ralbag assumes that the covenant would have had to occur much closer to Isaac's birth because Abraham hadn't yet despaired of having children thirty years prior to Isaac's birth. And he assumes that this is connected to Sarah giving Hagar to Abraham which was around fifteen years before Isaac's birth.
Perhaps uniquely among the commentators, Ralbag argued that the four hundred years began with Jacob's birth. This was because Jacob was the first of Abraham's progeny to sojourn in an ongoing manner. Moreover, Ralbag also uniquely argues that the four hundred years were not actually fulfilled, even counting from well before the actual stay in Egypt. Instead he argues that God shortened the time period in the merit of the Patriarchs as is implied in the account in Exodus (presumably 2:24). In fact, Ralbag uses this as a further critique of the other views, as according to them the full four hundred years were fulfilled.
Ralbag also explains why the number four hundred and thirty differs from the number four hundred. He argues (as did Rashbam) that the verse should be read as if there was an additional word "until" (as we find in other instances) in which case the verse is simply saying that it occurred four hundred and thirty years after a certain point, rather than that there were four hundred and thirty years of the prophesied hardships.
Ralbag presents two options as to what that certain point was: either Isaac's birth, or the prophecy itself. Thus, the amount of time actually spent in Egypt was either two hundred and forty years or two hundred and twenty five years (430 - 130 - 60 = 240 or 430 - 130 - 60 - 15 = 225).
Commentary to Genesis 15:13
ארבע מאות שנה. ר"ל עד סוף ארבע מאות שנה מעת הולד יעקב שהיה הראשון מהגרים מזרעו בארץ לא להם גרות מתמיד והנה מהר הש"י את הקץ כמו ששים שנה אם היה שלא ישבו ישראל במצרים כי אם מאתים ועשר שנה כמו שאמרו רז"ל ואפשר שיאמר אומר שהיה מושב בני ישראל שם מאתים ושבעים שנה וזה כי קהת אפשר שהיה כמו בן שתי שנים בבואו למצרים ואפשר שאחר זה הזמן ק"צ שנה הוליד עמרם שהוא בן קהת את משה והנה אי אפשר שנאמר שהיה זה הקץ מעת הולד יצחק לפי שלא ישלם לנו הקץ שזכר בפרשת בא והוא ארבע מאות ושלשים שנה וזה כי אי אפשר לנו שנאמר שזאת הנבואה היתה קודם הולד יצחק שלשים שנה לפי שאברם יצא מחרן כ"ה שנה קודם הולד יצחק וזאת הנבואה היתה בהכרח אחר בא אברם לארץ כנען בעת שהתחיל אברם להתיאש מלהיות לו זרע ולזה אמר ואנכי הולך ערירי וידמה שזאת הנבואה היתה סמוך לנתינת הגר לאברם לאשה ומה שאמר בעל סדר עולם שאחר זאת הנבואה שב אברם לחרן ועמד שם ה' שנים כדי לכוון החשבון הנזכר בפרשת בא הוא בלתי נראה לנו כי לא נתיאש אברם מלהיות לו זרע עד היותו בן שמנים וחמש שנה שישבו עשר שנים בארץ כנען ולזה השתדלה אז שרה לקחת בזה עצה וזה ממה שיראה ממנו שיהיה אמרו ואנכי הולך ערירי סביב הזמן ההוא ועם זה הנה לא תמצא שיצא אברם מארץ כנען אשר צוהו השם יתע' לשבת בה אם לא לסבה חזקה כמו הרעב הכבד כי היה בזולת זה עובר מצות הש"י ולזה לא יתכן שנאמר ששב לחרן ועמד שם חמש שנים וג"כ הנה הכתוב ספרי שכשהיו באים לארץ כנען באו לחרן וישבו שם וזה לאות כי לא באו מארץ כנען לחרן ועוד שאם היה הענין כן לא מהר השם יתע' את הקץ כשהוציא ישראל ממצרים והנראה ממה שנאמר שם שכבר מהר להם את הקץ למען בריתו עם האבות והנראה בעיני שהקץ היה מעת שנולד יעקב עד מלאת ת' שנה ומהר הש"י את הקץ שלשים שנה מפני חוזק העבודה הקשה אשר היו המצרים מעבידים את ישראל כאמרו ויאנחו בני ישראל מן העבודה ויזעקו ומנין ת"ל שנה היו מעת היות לאברהם זרע ר"ל מעת שנולד יצחק כי ביצחק נקרא לו זרע וממנו יהיה גם כן הזרע הגולה בארץ לא לו ויהיה מושב בני ישראל במצרים מאתים וארבעים שנה וזה נאות מאד בזה הענין ואפשר ג"כ שיהיה מנין ת"ל מעת הגעת הנבואה הזאת לאברם שהוא לפי הנראה בלתי פחות מט"ו שנה קודם הולד יצחק וזה שאחר זה נתנה שרה שפחתה לאברם והיה אז לאברהם שמונים וחמש שנים והנה מהר הש"י את הקץ לפי זאת ההנחה כמו מ"ה שנים ובעבור חטא המרגלים נתאחרו במדבר מ' שנה ונשארו ה' שנים שנכנסו לארץ קדם הקץ וזה נאות מאד כמו שנבאר בג"ה במה שיבא ר"ל שלא הגיע עדיין קץ כניסתם לארץ אחרי מות משה ולזה היו צריכים שיהיו באופן מהשלמות שתדבק בהם ההשגחה האלהית בדרך שינצחו מאומות ההם
Four hundred years. Meaning to say, until the end of four hundred years from the time of Jacob's birth, as he was the first of the sojourners from [Abraham's] seed to sojourn ongoingly in a land not belonging to them. And behold God expedited the end by about sixty years, if [we assume that] the Israelites only dwelled in Egypt for two hundred and ten years, as the Sages say.
And it is possible for someone to say that the Israelites dwelled there for two hundred and seventy years. And this is because Kehat was possibly around two years old when they came to Egypt, and it is possible that one hundred and ninety years after this Amram, who was the son of Kehat, begot Moses.
It is impossible to say that the end [of the four hundred years] was from Isaac's birth, because then the end time mentioned in Parshat Bo, which was four hundred and thirty years, cannot be completed. This is because Abraham left Haran twenty five years before Isaac was born and this prophecy had to have occurred after Abraham had come to the land of Canaan, at the time when Abraham began to give up on having children which is why he said "I go childless". And it would seem that this prophecy was near [the time of] the giving of Hagar to Abraham as a wife.
And that which the author of Seder Olam said, that after this prophecy Abraham returned to Haran and stayed there for five years, in order to reconcile the calculation mentioned in Parshat Bo, does not seem correct to us. This is because Abraham did not give up on having children until he was eighty five years old, when he had lived in the land of Canaan for ten years, which is why Sarah then crafted the plan [for Abraham to marry Hagar]. This is because it would appear that his statement "I go childless" should have been around this time.
Additionally, you don't find that Abraham left the land Canaan, which God had commanded him to dwell in, if not for a strong reason such as the harsh famine. For without this [strong reason] he would be violating the command of God. therefore it is not possible to say that he returned to Haran and stayed there for five years. And furthermore, the verse tells us that when they came to the land of Canaan they came to Haran and they dwelled there; this is to show that they did not come from the land of Canaan to Haran.
Moreover, if this was the case [that the four hundred years started from the birth of Isaac] then God did not expedite the end when he took Israel out of Egypt, yet it appears from what is written there that he did expedite the end on account of His covenant with the Patriarchs.
What appears to me is that the end is [calculated] from the time of Jacob's birth until the completion of four hundred years. And God expedited the end by thirty years because of the harshness of the difficult labor that the Egyptians forced upon the Israelites, as it says "the Israelites sighed from the servitude and they cried out". And the calculation of four hundred and thirty years was from the time that Abraham had a child, meaning from the time that Isaac was born, as with Isaac he was considered a child and from him as well were the descendants that were exiled in a land that was not his. And the dwelling of the Israelites in Egypt was two hundred and forty years, and this fits very nicely with this topic.
And it is also possible that the calculation of four hundred and thirty years was from the time this prophecy came to Abraham, which appears to have been no less than fifteen years before Isaac was born. This is because after this [prophecy] Sarah gave her maidservant to Abraham, and Abraham was then eighty five years old. And God expedited the end, according to this assumption, by about forty five years. And due to the sin of the scouts they were delayed in the wilderness for forty years, which left them entering the land five years before the end [of the four hundred years]. And this fits very well, as we will God-willing explain in what comes, namely, that the end for them to enter the land had not yet come after Moses died, and because of this they needed to be in a state of perfection so that the Divine Providence would cling to them in a manner that would be victorious over those nations.
Commentary to Exodus 12:40
ומושב בני ישראל אשר ישבו במצרים שלשים שנה וארבע מאות שנה. תחסר מלת עד וככה ארבעים יכנו ר"ל שהרצון בו עד ארבעים כמו שנבאר שם בג"ה והנה הרצון בזה הוא שישראל ישבו במצרים עד ארבע מאות ושלשים שנה ולא פירש מאי זה עת התחיל זה החשבון והנראה בעיני שזה החשבון מתחיל אם מעת שנולד יצחק אם מעת נבואת בין הבתרים כמו שבארנו בפרשת לך לך והנאות בעיני בזה שהחשבון הזה מתחיל מעת נבואת בין הבתרים והיתה נבואת בין הבתרים כמו ט"ו שנים קודם שנולד יצחק ויהיה זה החשבון מתחיל מעת הנבואה ההיא והנה ארבע מאות שנה שאמר השם יתע' לאברהם התחילו מעת שנולד יעקב כי הוא היה הראשון שגר בארץ לא לו גרות מתמיד והנה יצאו ישראל ממצרים קודם הקץ שנאמר לאברהם כמו ארבעים וחמש שנה והוא מבואר שאם היו ישראל שלמים היו נוחלים הארץ תכף צאתם קודם הקץ ולזה שלח משה מרגלים לתור את ארץ כנען זמן מועט אחר צאתם ממצרים אבל הטו עונותיהם ונתאחרו שם במדבר ארבעים שנה ואח"כ ירשו את הארץ על ידי יהושע והנה עכ"פ נתקיימה להם ירושת הארץ אם בבא הקץ שיעד השם יתע' לאברהם אם קדם לו זמן מועט כמו שיתבאר מדברינו במה שיבא ר"ל שכבר נחלו את הארץ קודם הקץ
And the dwelling of the Israelites that they dwelled in Egypt was four hundred and thirty years. The word "until" is missing. And so too "forty he shall strike him", meaning that the intent of it is until [but not including] forty, as we will God-willing explain there. And the intent of this is that Israel dwelled in Egypt until four hundred and thirty years, but it doesn't explain from what time this calculation began.
What appears to me is that this calculation began either from the time of the birth of Isaac or from the time of the prophecy between the parts, as we explained in Parshat Lech Lecha. And what is fitting in my eyes regarding this is that it began from the time of the prophecy between the parts. And the prophecy between the parts was about fifteen years before Isaac was born. And this calculation began from that prophecy.
And the four hundred years that God said to Abraham began from the time of Jacob's birth, for he was the first one who ongoingly sojourned in a land not his. And Israel left Egypt before the end [of the four hundred years] that was said to Abraham by about forty five years. And it is clear that had Israel been perfect they would have inherited the land [of Canaan] immediately after leaving [Egypt], before the end [of the four hundred years]. And that is why Moses sent scouts to tour the land of Canaan a short time after they left Egypt. But their sins diverted them and they were delayed there in the wilderness for forty years. And after that they inherited the land through Joshua. But despite this their inheritance of the land was still fulfilled, whether with the coming of the end that God had promised Abraham or slightly earlier, as will be explained with our words in what is to come. I.e. they already inherited the land before the end [of the four hundred years].
A final noteworthy point is that Rambam (Epistle to Yemen — Iggeret Teiman) explains that although the correct calculation of the four hundred years ended up being from Isaac's birth, the prophecy itself was vague and the calculation could have been from some other point, and various people did mistakenly calculate it until the correct calculation became known through Moses taking them out of Egypt four hundred years after Isaac's birth.