Alternate Timelines are not strict branches
Parallel universes can often mess with your mind if you're not careful. You need to pay careful attention to both where you are, what are the possibilities, and what has occurred to affect change. DBZ uses the alternate timeline version of time travel, so this means that many universes can exist, shown or not. A diagram will be easiest.
Timeline
There are actually 4 different timelines involved in the Cell/Trunks/Android Saga (excluding ones created/changed by time travel).
Cell to DBZ
The first timeline is one in which the Androids have ravaged the earth, and cause chaos. All of the main heroes have died, and Trunks (I'm calling him Trunks "killed") is left to fend for himself. He travels back in time to an alternate DBZ timeline (one we don't see or know much about, but there is only 1 version of Cell in this timeline) to give Goku the medicine. Presumably, he defeats the androids and/or give Goku the medicine, then travels back to his own timeline. At this point, he (Trunks "killed") is killed by Cell (who is the main Cell in the series), and Cell (main) steals his time machine to travel back in time.
Trunks to DBZ
Cell (main), travels to the known DBZ timeline from the show. He shows up and that process starts. Trunks (the one called Future Trunks often, the one in the show and in History of Trunks) meanwhile, in his own, future timeline (likely related, see below), also travels back in time, also to the current DBZ known timeline, to warn about the Androids. When he arrives, there are 2 Cells in this timeline, the main one, and one that already existed. The one that is native to this timeline (called Present Cell often), is destroyed with the destruction of the lab by Future Trunks, and Krillin.
Loose Ends
Blah, blah, blah. Cell saga continues until Cell (main) is destroyed. At this point, Future Trunks, travels back to his own timeline, and there, already knows about, and destroys the Cell in that timeline (Future Cell). In total, there were:
- 5 Cells (the forth is never mentioned, but likely grew into a full Cell later in the alternate DBZ timeline; fifth is assuming Future Trunks' timeline is derivative, see below)
- 4 timelines
- 2 Trunks from the Future
- 2 Trunks from the present
- 2 time machines
The question: Why?
So why did Trunks arrive in the same Universe as Cell? Well, that's easy. He did, and he didn't. He arrived in the timeline we were shown (the main DBZ continuity), but the previous Trunks arrived in one in which the Future Cell had not arrived yet. The theory of alternate timelines often involves time travel on a single thread. That is, Future Trunks' universe likely existed from a timeline branch in which Cell (main) had already arrived. When Future Trunks traveled back in time, he was traveling to his past, which included Cell (main) being there, but none of the events that had been set into motion to lead to his timeline. His presence then altered the timeline to include the events we saw, and to not include the ones that lead to his time.
Basically, if Trunks didn't go back in time, things could have happened in a way which lead to Trunks going back in time, which caused the series of events in which we saw. Simple, right?
What happened to Cell (main) in Future Trunks' timeline?
We don't know. Likely something. But we don't have anything to state what might have happened.