In tasks determined by human typing speed, the difference will be slight. In anything machine-dependent, the i5 will utterly blow the E8400 out of the water. Keeping in mind that you'll likely be running Windows, and should have anti-virus and other security software, likely a backup scheduler, and other programs running at the same time, you'll definitely want the i5.
If the option is available to you, an i3-8100 would make a good choice. It also runs four threads like the i5, and being a couple generations newer, should have a higher IPC and perform as well or better. The difference between that and an i5-8400 would probably go unnoticed for most office work.