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.


[[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. It was Cell, Gero's supreme creation -- who wasn't involved in the plan to kill Goku at all -- who completed Gero's objective [[ActionBomb by self-destructing]] and [[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 Out-Gambits]] 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 the 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.
* The climax of ''Manga/JojosBizarreAdventureBattleTendency'' plays this to ridiculous extremes. Confronted by Kars, who has managed to become the UltimateLifeform, Joseph decides to grab the [[MacGuffin Red Stone of Aja]] and run. Eventually Joseph manages to dump Kars into a volcano, but he survives thanks to his AdaptiveAbility. Kars then proceeds to cut off one of Joseph's hands and decides to kill him using the Ripple to invoke IronicDeath, but Joseph ends up blocking it with the Red Stone of Aja, triggering the volcano to erupt, sending both of them on a rock high into the sky. Kars tries to escape by growing wings, but Joseph's severed hand ends up distracting him long enough for stray volcanic rock to hit him and launch him even higher, outside of the Earth's atmosphere. Jojo comments to himself that he planned none of this out, but his reputation for cunning schemes allows him to claim that he planned everything from the start, [[TheGadfly knowing the Kars would be pissed off thinking that]].
* In ''Mange/OnePiece'', [[BigBad Blackbeard]] planned to capture series protagonist Monkey D. Luffy and hand him over to the World Government in order to get appointed as a [[{{Privateer}} Warlord]]. But then Luffy and his crew got [[ItMakesSenseInContext shot up into the sky]] right when he approached them and, sometime later, Luffy's brother Ace (who's an even more notable pirate than Luffy) showed up to confront Blackbeard over unrelated matters. Blackbeard captures Ace instead and his plans go even ''better'' because of it, as a series of crazy events ultimately leads to Blackbeard getting himself a NextTierPowerUp.

[[folder: Film ]]
* Played straight over the course of the ''Franchise/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 ''Film/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.
* In ''Film/LicenceToKill'', Film/JamesBond is trying to assassinate Franz Sanchez [[ItsPersonal to avenge his friend Felix Leiter and his wife Della]]. However, he gets stopped by Hong Kong narcotics moles who were infiltrating Sanchez's syndicate. However, he gets Sanchez to believe one of his associates was behind the attempt instead. Sanchez has the associate brutally executed and he gives Bond a place in his inner circle.

[[folder: Literature ]]
* ''Literature/HarryPotter'':
** In a rare villainous example, 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.
* ''Literature/FoundationAndEmpire'': [[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.
* One of Asimov's short stories had the administrator of an UnderwaterCity believing that two visitors, husband and wife, are observers from a council with significant authority over Earth, especially colonization programs, and that they will make a report that (he believes unfairly) will help contribute to ocean colonization resources being redirected to bolster space colonization, so he plans a suicidal 'accident' to desperately derail it. This leads to the woman bluffing that she ''is'' a member of the council, and that not only wouldn't the plan work to its intended goal, but the ocean colonization program is pivotal to part of the space colonization program, and therefore won't be shut down, so it's pointless too. When the administrator stands down and entire thing is over, and the two visitors are on their way back home, it is revealed that [[spoiler: the husband ''is'' a member of the council, and while they might not have been thinking in that direction before, his wife made a very good argument for why the ocean colonization program should continue...]]


[[folder: Live Action TV ]]

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


[[folder: Web Original ]]

* In ''Film/NoobLeConseilDesTroisFactions'', Gaea's TheScrooge attitude in ''Series/{{Noob}}'' turns out to have had ulterior motives. Besides a bunch of money, the plan needed one of the game's larger guilds as a target. When she excecutes it on Roxxor, the biggest guild of the Coalition, she admits that her initial target was Justice from the Empire, her former faction. What happened between the two? Mid-way through ''Series/{{Noob}}'', a FrameUp made her hated in the Empire and she got a literal fan club whose members were convinced that she was a DoubleAgent faithful to the Coalition. She spent some time basically giving the SureLetsGoWithThat treatment to the fan club while staying in the Empire, but a moment of disappointment with her Empire guild made her change factions, which was made easier by her fan club welcoming her with open arms. With the new faction came a new large guild to target.


[[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. By this time, though, Discord had undergone a HeelFaceTurn, though [[ItAmusedMe it still amused him]] to sit back and see how it played out as an [[TricksterMentor impromptu test]] for Twilight]].
* In ''WesternAnimation/YoungJustice'' it seems like the [[spoiler:[[ReverseMole Aqualad double agent]]]] plan is doomed to failure thanks to Miss Martian [[spoiler:inflicting a MindRape on him to "avenge" Artemis who wasn't really dead. Artemis manages to bring her onto Black Manta's sub via a staged kidnapping to fix the damage, but now Miss Martian can't escape without exposing the scheme.]] 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.
* In the ''WesternAnimation/StevenUniverse'' episode "Gem Drill", [[spoiler: Peridot and Steven drill into the depths of the Earth to reach the Cluster, an enormous conglomeration of shattered Gem shards left beneath the surface by Homeworld, and destroy it before it awakens and destroys the Earth. Peridot's drill is unable to damage the Cluster, but Steven is able to use his empathetic powers to communicate with the Cluster and convince its components to bubble each other and save the Earth.]]


[[folder: Other ]]

* [[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 normally turn-ending penalty draw either completes a pair or it's what you asked for, it doesn't end your turn.