It depends on your target.
If it's to finish - without wishing to undervalue the achievement and training needed - is not beyond most people.
If it's to run a fast time obviously a structured plan needs to be in place.
I've run four London marathons and in order I completed the course in:
5:54
5:35
5:12
6:17
You can knock approximately 15 minutes off all these times for time it takes to cross the start in a big city event.
That PB of 5:12 was done with sporadic training starting just 9 weeks before race day. This was because I got a last minute charity place and it took place at the time of my first child so hectic times.
I ran with a walkman, a camera and just enjoyed it. I took the pressure off myself and therefore I relaxed and i found it much easier.
The last run was slower because I was carrying an injury and I probably shouldn't really have taken part but hey, it's a marathon - you don't do them every day.
You have to be sensible though and be realistic in your expectations.