"And the children of Israel ate the manna forty years" (Exodus 16:35). Rabbi Joshua says: Israel ate the manna forty days after the death of Moses. Moses died on the seventh of Adar, and they ate of it the twenty-four remaining days of Adar and sixteen days of Nisan. And so it says, "And the manna ceased on the next day, when they had eaten of the produce of the land" (Joshua 5:12). Rabbi Eleazar of Modiin says: the twenty-four days of Adar, and thirty days of a second Adar, for that year was a leap year, and they ate of it until the sixteenth of Nisan. And so it says, "And the manna ceased on the next day." Others say: Israel ate the manna fifty-four years. Forty years in the wilderness, seven of the conquest, and seven of the apportioning of the land, as it is said, "until they came to an inhabited land" (Exodus 16:35). What does "an inhabited land" teach? It teaches that for fourteen years Israel ate the manna after the death of Moses.
How Many Years Israel Ate the Manna in the Wilderness
Mekhilta DeRabbi Shimon Ben Yochai 16:32
ובני ישראל אכלו את המן ארבעים שנה ר' יהושע אומר ארבעים יום אכלו ישראל את המן אחר מיתתו של משה מת משה בשבעה באדר ואכלו ממנו עשרים וארבעה של אדר וששה עשר של ניסן וכן הוא אומר (יהושע ה' י"ב) וישבת המן ממחרת באכלם מעבור הארץ: ר' אלעזר המודעי אומר עשרים וארבעה של אדר ושלשים של אדר שני שהיא היתה מעוברת ואכלו ממנו ששה עשר בניסן וכן הוא אומר וישבת המן ממחרת: אחרים אומרין ארבע וחמשים שנה אכלו ישראל את המן ארבעים שנה במדבר ושבע של כבוש ושבע של חלוק שנ' עד בואם אל ארץ נושבת מה ת"ל ארץ נושבת מלמד שארבע עשרה שנה אכלו ישראל את המן אחר מיתתו של משה: