A couple of things to try and pin it down.
1. When it's not working try wiggling the fan speed control about push and pull against it to see if the fan suddenly starts working
2. Look up under the dash on the passenger side at the condition of the wires going to the fan speed resistor and the fan it's self
Usually the speed control has broken or the wiring is burnt and breaking down, I had a very similar issue with my grande with burnt wires to the resistor pack (more an indication of excessive heat than the actual problem) causing intermittent problems with the electrical connectors behind the dash
Worst case is this sort of thing can lead to fires so definitely get it sorted sooner rather than later