I explained that initially. But unless you control the Router, you do not have access to separating the two bands from each other, and are at the mercy of the Mac choosing one or the other very bad connections.
Can you make an Ethernet connection, or is your router dead-dead?
--------
You may be running stuff on the iMac in the background that is hogging the very small bandwidth available on the iMac.
If you have installed software that wastes computer resources on a regular basis, such as speeder-uppers, Cleaners, Optimizers, Virus Scanners, third-party file Sync-ers such as DropBox, OneDrive, or GoogleDrive, or a VPN, it will do busywork and waste scare resources at phenomenal speeds.
Sync-ing an iPhoto library is also know to crater a marginal Wi-Fi connection.
The usual "litmus test" is to restart in safe mode, and measure the speed (such as Internet speed test) there, because it does not load any third-party add-ons.