Although this is not related to a switch-controlled outlet, this means you have one circuit coming in that then branches out to two additional connections. Since it was a light, which would be on a switch, the additional wires would most likely go to another light (or possibly already to a switch-controlled outlet). If that is the case, and you want to keep it that way, you can simply pigtail each set of matching color wires and connect the pigtail to the fan. That will basically be like plugging the fan into an outlet on that circuit that is controlled by the switch.

Talk Doctor Online in Bissoy App