This article is an excerpt from our Sefer
Buy me here or on Amazon.com
In doubt if said Ya’aleh Veyavo by Shacharis or Mincha:
If one is in doubt as to whether he recited Ya’aleh Veyavo in Shacharis or Mincha, then some Poskim rule he fulfills his obligation and is not required to return to Ritzei or repeat Shemoneh Esrei. Other Poskim, however, rule that it has the same law as one who did not say Ya’aleh Veyavo and he must hence return to Ritzei or repeat Shemoneh Esrei [of Mincha, and Shacharis, if he remembered the doubt after Shacharis, prior to Davening Musaf]. Practically, one is to repeat Shemoneh Esrei as a [Tnaiy] Nidavah. [One is to repeat the Shemoneh Esrei in such a case even on Shabbos Rosh Chodesh, however not as a Tefilas Nidavah.]
 Rama 422:1; Darkei Moshe 422:1; Kol Bo 11 in name of Yerushalmi Brachos 55a; Taz 422:1 rules that if he remembered to say Ya’aleh Veyavo in Shemoneh Esrei [prior to reaching Ritzei] and then later he is in doubt as to what he actually said, then he is not required to repeat Shemoneh Esrei as we assume he said it.
 The reason: As one does not past 30 days without reciting Yaleh Veyavo, and hence there is no Chazakah in existence to say that it was not said. we therefore are forced to apply the rule of Safek Brachos Lihakel. [See Darkei Moshe 422:1; M”B 422:10]
 M”A 422:4; Beis Yosef 422 argues on Kol Bo; Bach 422; Rokeiach in name of Yerushalmi [brought in M”A ibid]; Implication of Yerushalmi Taanis 2b, brought in Beis Yosef ibid; Yerushalmi Brachos 3, brought in Rashba Brachos 29b and Tzemach Tzedek 3:7; Peri Chadash 422; Elya Raba 422:6; Tzemach Tzedek 3 letter 7; Mamar Mordechai 422:7; Birkeiy Yosef 422:3 in name of Mahriy Malko; Kesher Gudal 21:8; Shaareiy Teshuvah 422:4; Beis Oved 5; Chayeh Adam 24:44; Derech Hachaim 33:82; M”B 422:10 “So is the Halacha, as majority, if not all, Achronim argue on the Rama and rule as above”; See Taz ibid that if he did not remember to say Ya’aleh Veyavo in Shemoneh Esrei before Ritzei then he must repeat Shemoneh Esrei. The Birkei Yosef ibid rules that even if he remembered he is required to repeat
 The reason: As everyone sees that the common wording of Shemoneh Esrei does not include Ya’aleh Veyavo and hence when in doubt one is to assume that he said the common wording. [M”A ibid] Alternatively, the reason is not due to one’s common wording and assumption that he didn’t say it, but rather due to the fact that by prayer it is permitted to say a blessing in a real case of doubt, And we do not apply the law of Safek BrachaLehakel. [Tzemach Tzedek ibid]
 Kaf Hachaim 422:18 rules that one is to repeat the prayer as a Tnaiy, that if he must repeat it then he is repeating it as an obligation and if he is not obligated to repeat it then it is a Tefilas Nedava; See also Admur 107:1 [based on M”A 107:1 and Rashba Brachos 21a] for a similar ruling that if one is in doubt if he Davened Shemoneh Esrei, he is to repeat it as a Tnaiy Nedava. This implies that it does not suffice to repeat it as a pure Nedava without a Tnaiy, as a Nedava Shemoneh Esrei does not fulfill his obligation Shemoneh Esrei, and hence a Tnaiy is required. Vetzaruch Iyun why this matter was not explicitly written in the Poskim in next footnote. See also Admur 117:1 and 582:2 who does not mention to Daven again as a Tnaiy Nedava, but simply as a Nedava. Perhaps, however, we can answer, that the mere fact one is repeating it due to the doubt and is not novelizing something in the Shemoneh Esrei, is itself considered as if one made the Tnaiy, upon repeating it as a Nedava. [In other words, whenever one repeats Shemoneh Esrei as a Nedava due to a dispute, it is considered as if he made the above stipulation, even if he did not consciously do so.]
 Kneses Hagedola 422; Nesiv Hachaim 33:15; Kaf Hachaim 422:18; The Tzemach Tzedek 3 letter 7 rules like the second opinion that one is required to repeat Shemoneh Esrei. Nonetheless, above we wrote to Daven it as a Tnaiy Nedava, being that one has nothing to lose by doing so, and is not considered to having said a blessing in vain even according to the first opinion.
The law if one remembered prior to finishing Shemoneh Esrei: Tzaruch Iyun as to what should be done if one remembered his doubt prior to finishing Shemoneh Esrei, as one cannot go back and repeat the remaining blessings as a Nedava, and hence whatever one does is faulty according to one opinion. Accordingly, it would seem that since the main opinion follows the opinion that one does not fulfill his obligation in such a case, that he should go back to Ritzei. However, the Poskim ibid do not make mention of this and seem to imply that one should simply finish Shemoneh Esrei and repeat it as a Nedava. Perhaps the reason is because everyone agrees that reciting a Shemoneh Esrei without Meiyn Hameura is not defined as a blessing in vain, even though the person does not fufill his obligation. Vetzaruch Iyun
 As the Tzemach Tzedek [and majority of Poskim] rule like the M”A that one is to repeat Shemoneh Esrei, and thus even on Shabbos one is to repeat it, even though one does not Daven a Nedava on Shabbos. However, during the week, since one is able to Daven as a Nedava and fulfills his obligation according to all, it is best to do so. [See Likkut Dinei Rosh Chodesh 6 footnote 14]