The Tur (Halachic code by Rabbi Yaakob Ben Asher, Spain, 1270-1340), in Orah Haim (93), cites from earlier sources that it is proper to speak words of Torah immediately before reciting the Amida. This Halacha is codified in the Shulhan Aruch (93:2), and forms the basis of the widespread custom to recite Ashreh immediately before the Amida at Minha. (At Shaharit and Arbit, we in any event recite Shema and its accompanying blessings before the Amida.)
This gives rise to a question concerning a person who comes late to the synagogue for Minha, and sees that the congregation had already begun reciting the Amida. Should he begin the Amida right away, so that he could participate with the congregation’s prayer, or should he first recite Ashreh before beginning the Amida?
Hacham Ben Sion Abba Shaul (Israel, 1923-1998) addresses this question in his work Or Le’sion (vol. 2, 15:3), and rules that in such a case one should skip Ashreh and immediately begin the Amida. He adds, however, that a separate Halacha requires waiting several seconds after entering the synagogue before beginning the Amida prayer. Upon entering the synagogue, a person must not begin the Amida until he waits the amount of time required to walk eight Tefahim (handbreadths), or around 2-3 seconds. Therefore, if a person comes into the synagogue late for Minha, after the congregation had begun the Amida, he should wait 2-3 seconds and then begin the Amida without reciting Ashreh.
Of course, after Minha he may recite Ashreh to earn the promise mentioned in the Talmud that one who recites Ashreh three times daily is guaranteed a share in the next world. He should not, however, recite Ashreh before the Amida in this case, despite the fact that one should generally recite Ashreh before the Amida at Minha.
Summary: One who comes to the synagogue for Minha and sees that the congregation had already began the Amida should wait 2-3 seconds and then begin reciting the Amida, without reciting Ashreh. If he wishes, he may recite Ashreh afterward.