"I am forty years old this day" (Joshua 14:7). Our Rabbis taught: the days of the Tent of Meeting in the wilderness were forty years less one; the days of the Tent of Meeting at Gilgal were fourteen years, seven during which they conquered and seven during which they divided the land; the days of the Tent of Meeting at Nob and Gibeon were fifty-seven; there remained for Shiloh three hundred and seventy less one. The days of the Tent of Meeting in the wilderness were forty less one. Whence do we know it? As it is said, in the first year Moses made the Tabernacle, in the second it was set up and he sent the spies. The fourteen at Gilgal, seven during which they conquered, whence do we know it? Because Caleb said, "forty years old was I when Moses sent me," and now "behold, I am this day eighty-five years old" (Joshua 14:7,10). When they crossed the Jordan how old was he? Seventy-eight, and he said eighty-five; behold, seven during which they conquered. And seven during which they divided, whence do we know it? If you say from this, that as seven they conquered so seven they divided; and if you say, because no fourteen years are found after the city was smitten. At Nob and Gibeon fifty-seven, as it is written, "and it came to pass, when he made mention of the ark of God, that he fell from off his seat" (1 Samuel 4:18). And it was taught: when Eli the priest died, Shiloh was destroyed and they came to Nob; when Samuel died, Nob was destroyed and they came to Gibeon. And it is written, "and it came to pass, from the day that the ark abode in Kiriath-jearim, that the time was long, for it was twenty years" (1 Samuel 7:2). Which are the twenty years? Eleven of Samuel himself, and two of Samuel and Saul, and seven that David reigned in Hebron. And it is written, "and the days that David reigned over Israel were forty years; in Hebron he reigned seven years" (1 Kings 2:11). And it is written, "and he began to build it in the second month, in the fourth year of his reign" (1 Kings 6:1, with 2 Chronicles 3:2). There remained for Shiloh three hundred and seventy less one.
Forty Years and the Long Tally of the Tabernacle to Shiloh
Yalkut Shimoni on Nach 23:1
בן ארבעים שנה אנכי היום (יהושע יד, ז). ת"ר ימי אהל מועד שבמדבר ארבעים שנה חסר אחד, ימי אהל מועד שבגלגל י"ד שנה שבע שכבשו ושבע שחלקו, ימי אהל מועד שבנוב וגבעון נ"ז, נשארו לשילה שלש מאות ושבעים חסר אחד. ימי אהל מועד שבמדבר ארבעים חסר אחד מגלן, דאמר מה שנה ראשונה עשה משה את המשכן בשניה הוקם ושלח מרגלים, י"ד בגלגל שבע שכבשו מנא לן, דקאמר כלב בן ארבעים שנה אנכי בשלוח משה ועתה הנה אנכי שמונים וחמש שנה, כי עברו לירדן בר כמה הוה בר שבעים ותמני וקאמר בן שמונים וחמש הרי שבע שכבשו. ושבע שחלקו מנא לן, אי תימא מדשבע כבשו שבע חלקו, ואי תימא מדלא אשכח י"ד שנה אחר שהוכתה העיר. שבנוב וגבעון נ"ז, דכתיב ויהי בהזכירו את ארון האלהים ויפול מעל הכסא, ותניא כשמת עלי הכהן חרבה שילה ובאו להם לנוב, כשמת שמואל חרבה נוב ובאו לגבעון, וכתיב ויהי כשבת ארון האלהים בקרית יערים וירבו הימים ויהיי עשרים שנה. הי נינהו עשרים שנה י"א דשמואל עצמו ושתים דשמואל ושאול ושבע שמלך דוד בחברון, וכתיב והימים אשר מלך דוד על ישראל ארבעים שנה בחברון מלך שבע שנים, וכתיב ויחל לבנותו בחדש השני בשנת ארבע למלכותו נשתיירו לשילה שלש מאות ושבעים חסר אחת: