When Matthew narrates the scene of the last supper, Jesus was dining with his twelve disciples (Matt. 26:20). So Judas was present–at first.
Jesus said, “Truly, I say to you, one of you will betray me” (Matt. 26:21). The disciples replied, one after another, “Is it I, Lord?” (26:22). Matthew doesn’t focus on any individual yet. Then after Jesus said it would have been better if the betrayer had never been born (26:24), Judas speaks. “Is it I, Rabbi?” (26:25).
The narrative continues in Matthew 26:26-28 with the dispensing of the bread and the passing of the cup, and the impression is that all twelve disciples receive the bread and cup from Jesus. Matthew doesn’t report anyone missing.
But the Fourth Gospel sheds some light on this table. When Jesus said “one of you will betray me” (John 13:21), the disciples were uncertain of the betrayer’s identity (13:22). The beloved disciple (probably John?) was sitting beside Jesus (13:25). He asked, “Lord, who is it?” (13:25). Jesus responded, “It is he to whom I will give this morsel of bread when I have dipped it,” and then Jesus dipped a morsel and handed it to Judas, who must have been sitting next to him on the other side (13:26). Despite what a moment this was, the rest of the group seemed oblivious (13:28). But Judas knew that Jesus knew.
Now comes John 13:30: “So, after receiving the morsel of bread, he immediately went out. And it was night.”
Here’s how the events may have unfolded at the last supper. Jesus prophesies a betrayer from the twelve, and the disciples respond with uncertainty (Matt. 26:20-25). With this conversation still hanging in the air, the beloved disciple asks the identity of the betrayer, Jesus says he will give a dipped morsel to the betrayer, Jesus then gives the dipped morsel to Judas, and after receiving the morsel Judas immediately left (John 13:25-30).
Only then does the meal transition to the breaking of the bread and the passing of the cup (Matt. 26:26-28). While Jesus began the meal in 26:20 with all twelve disciples present, by the time he interpreted the bread as his body and the cup as his blood, Judas had already left (John 13:30).