I have a MacBook that requires a MagSafe charger, but my charger broke in mid 2016. My MacBook was holding 40%+ charge and no longer being charged. I am wondering if I can still charge it today? If yes, I am going to order a charger online.
There's no other way to find out than to try it.
In general there's nothing that says that a battery must stop working because it hasn't been charged in two years - batteries like those really age more due to heavy use rather than lying around on a shelf. So unless something bad happened to the computer or the battery over those two years, it is probably going to work just fine.