Where although the original plan didn't work out, something else that may or may not be completely unrelated accomplishes the same goal. When played for laughs, expect the person who made the original plan to still say, "[[IMeantToDoThat Just as planned.]]" May also involve MacGyvering if the unplanned event simply gives the hero what is necessary to recover from the failed plan. Might also turn a FunnyBackgroundEvent into a ChekhovsGun.

Often used to invoke an IMeantToDoThat. Might also involve the plan going horribly wrong and then what caused it to go wrong yielding the intended result. Contrast NiceJobBreakingItHero and NiceJobFixingItVillain, for when they unintentionally rescue their enemies' plans. Compare and contrast XanatosSpeedChess and GambitRoulette, which involve planning for things that could ruin your plans or adjusting your plans when they might fail. Inverse of SpannerInTheWorks, where someone or something causes what would have been a perfect plan to not accomplish its goal.

----
!!Examples
[[foldercontrol]]

[[folder: Anime & Manga ]]

* ''Franchise/DragonBall'': Doctor Gero created several androids to kill Goku. Unfortunately for him, either they were too weak to kill him or they performed a HeelFaceTurn. However, the apparation of Cell, Gero's supreme creation, who wasn't involved in the plan to kill Goku at all, managed to complete Gero's objective [[ActionBomb by self-exploding]], [[TakingYouWithMe killing Goku in the process]].
* In the last episode of ''Anime/PantyAndStockingWithGarterbelt'', after Panty and Stocking beat the BigBad, Garterbelt comments that things went "approximately as planned", reflecting on the fact that [[spoiler:he temporarily died during the battle]] and that the BigBad managed to go OneWingedAngel. This follows up on two "just as planned" comments and one "not as planned" comment earlier in the episode.
* In ''Manga/DeathNote'', Light [[OutGambitted OutGambits]] Near by [[spoiler:fooling him into stealing a fake Death Note]]. However, because of Mello's own unrelated failed IndyPloy to kidnap Takada, [[spoiler:Near realizes the note is fake and is alerted to the location of the real Death Note, which he also steals and replaces with his own fake, allowing him to outwit Light]].
* Just before he dies, Uchiha Itachi plants a mysterious crow inside of Manga/{{Naruto}} with message, "I hope you never have to use it." Jump to the 4th Ninja War where Itachi has been revived as a zombie under the enemy's control. He and Naruto fight, that crow appears, and suddenly Itachi is on the good guys' side. Itachi explains that the crow contained a pre-prepared genjutsu that would hypnotized whoever saw it to protect Konoha, programmed to only to respond to the presence of Itachi's eyes. The plan was that if [[RivalTurnedEvil Sasuke]] decided to turn on the Leaf and use Itachi's eyes to power himself up, the genjutsu would turn him good. However, now in control of himself, Itachi can work to undo the resurrections ''and'' talk some sense into Sasuke personally.

[[/folder]]

[[folder: Film ]]

* Played straight over the course of the ''StarWars'' saga. Qui-Gon's original plan was for Anakin to bring balance to TheForce. However, he ends up falling to the Dark Side and it seems that he won't. In ''ReturnOfTheJedi'', however, he does bring balance to the Force by ensuring that the last of the evil aspect of the Dark Side of the Force dies with him.
* In ''Film/{{Predator}}'', Dutch's plan to lure the titular menace into a deadly knife-trap fails when the Predator spots what he's up to and simply goes around it. Just as its about to kill him, Dutch notices its standing right under the trap's triggering mechanism... a giant log.


[[/folder]]

[[folder: Literature ]]

* ''Literature/HarryPotter'' has a rare example for the villain. Voldemort is unaware that [[spoiler: Harry is his final (de facto) Horcrux.]] As a result, he gave himself a way to win even after the other sources of his power were destroyed. [[spoiler:[[NiceJobFixingItVillain He ruins it, though, by using the Killing Curse on Harry again]].]]
** The heroes had one in place as well. Dumbledore originally planned [[spoiler:to depower the Elder Wand by having Snape kill him by consent. This was ruined when Draco Malfoy Disarmed him during their encounter, and Dumbledore never got a chance to reclaim it. Later, Harry Disarmed Draco of his usual hawthorn wand, taking it for his own—and by doing this, ''Harry'' (by pure luck) became the master of the Elder Wand, essentially preventing Voldemort from ever becoming its master. This is eventually what allows Harry to win against Voldemort.]]
** It happens all the time in the series. Harry even {{lampshades}} this.
--> "We plan, we get there, all hell breaks loose."
* In ''Literature/TheLordOfTheRings'', Gandalf and Aragorn's BatmanGambit pays off in getting the One Ring to Mount Doom, but the One Ring itself [[SpannerInTheWorks spans]] their plans by finally corrupting Frodo at the last crucial moment. Fortunately, Gollum shows up to take the ring for himself before accidentally falling into the volcano and destroying it.
** Though some fans postulate that Iluvatar (God) had planned this out all along and had shared his plan with Gandalf.
* ''Literature/{{Foundation}}'': In Foundation and Empire, [[spoiler:Devers constructs an elaborate plan to defeat Bel Riose and TheEmpire, only for it to do nothing and political infighting on Trantor win the war for them.]] This is taken as a sign of the inevitability of the Seldon Plan's success.
* When the heroes of ''Literature/{{Relativity}}'' encounter a powerful telepath named August Moon, they find it nearly impossible to fight him because he can read their minds and know what their attacks will be before they make them. At one point, however, Ravenswood sadly recalls how he and August used to be friends before he became a villain. The memory distracts August long enough for him to be defeated.

[[/folder]]

[[folder: Live Action TV ]]

* Freqently on ''Series/TheATeam'', prompting Hannibal to spout his CatchPhrase, "I love it when a plan comes together."

[[/folder]]

[[folder: Western Animation ]]

* ''WesternAnimation/ScoobyDoo'' loves this trope. Fred's plan to capture the MonsterOfTheWeek usually backfires because of Scooby and Shaggy's stupidity but somehow, in a way usually unrelated to Fred's plan, the monster is still caught at the end.
* At the end of the two-part ''WesternAnimation/MyLittlePonyFriendshipIsMagic'' episode "Princess Twilight Sparkle", it is revealed that [[spoiler:before he was turned to stone over a thousand years ago, Discord planted magic seeds meant to steal magic from the Tree of Harmony, capture Princess Celestia and Princess Luna, and spread across Equestria. However, the tree's magic prevented the seeds from flourishing. After over a thousand years, the tree weakens just enough for the plants to resume Discord's original intent]].
* In ''WesternAnimation/YoungJustice'' it seems like the [[spoiler:Aqualad double agent]] plan is doomed to failure as thanks to Miss Martian [[spoiler:Frying his brain to "avenge" Artemis who wasn't really dead]] and having to bring her onto Manta's sub to fix this, there's no way to get her off safely (Manta's gonna kill her once she's done) without tipping Manta off and scrubbing the mission. Cue Sportsmaster and Chesire raiding Manta's sub [[spoiler:also trying to avenge Artemis]] and inadvertantly breaking her out, allowing her to escape and cover her tracks.

[[/folder]]

[[folder: Other ]]

* Some marketing campaigns have this. The commercials may not be getting the right message across, but they sell the product just the same.
** [[Advertising/TheManYourManCouldSmellLike The Old Spice commercials]] fit this trope pretty well. It was supposed to advertise a body wash, but no-one seemed to buy that particular product. However, the Old Spice brand as a whole has become far more popular.
* Go Fish. A house rule (so common that most people don't know it's not a base rule) is that if you ask for the wrong card and your turn-ending penalty draw either completes a pair or it's what you asked for, it doesn't end your turn at all.
----