Let us take a long look at not only the two Scriptures you quote, but what other Scriptures have to do with the tripartite Godhead:
All Scripture is quoted from the King James translation, unless otherwise noted:
1st Timothy 5:21 I charge thee before God, and the Lord Jesus Christ, and the elect angels, that thou observe these things without preferring one before another, doing nothing by partiality.
Your question appears to be asking why this Scripture says the elect Angels instead of the Holy Spirit, but the answer to that is in the verse following the second Scripture you quote.
Matthew 28:19 Go ye therefore, and teach all nations, baptizing them in the name of the Father, and of the Son, and of the Holy Ghost:
and the following verse in Matthew tells us why:
Matthew 28:20 Teaching them to observe all things whatsoever I have commanded you: and, lo, I am with you always, even unto the end of the world. Amen.
Here Jesus is telling them that he will be with them always, after just having died and been resurrected, and then telling Mary Magdalene he was going to ascend to the Father, So how does that make any sense? Well in order to understand that we are going to have to look at some other Scriptures:
Matthew 28:18 And Jesus came and spake unto them, saying, All power is given unto me in heaven and in earth.
It is noteworthy that he said All power and not just, the power.
So let us look at what Jesus said to the Disciples before he died which has some bearing on this:
John 14:26 But the Comforter, which is the Holy Ghost, whom the Father will send in my name, he shall teach you all things, and bring all things to your remembrance, whatsoever I have said unto you.
Here Jesus is promising that he will send the Holy Spirit back to them as a comforter, and he is also saying that the Holy Ghost will have a dual purpose not only to bring them the peace of Jesus but to show them the way Jesus wants them to live, and also us. Jesus gave his peace to the disciples and to us in:
John 14:27 Peace I leave with you, my peace I give unto you: not as the world giveth, give I unto you. Let not your heart be troubled, neither let it be afraid.
He went on to say:
John 14:28 Ye have heard how I said unto you, I go away, and come again unto you. If ye loved me, ye would rejoice, because I said, I go unto the Father: for my Father is greater than I.
This Jesus said while he was still in his human body, and after his death and resurrection He said he has been given all power both in Heaven and on Earth, so it seems that God the Father turned over all of his power to Jesus after he returned to Heaven as he told Mary Magdalene. Then after he ascended before a crowd of about two hundred people he sent the Holy Spirit to be the promised comforter.
Acts 2:1 through 4 And when the day of Pentecost was fully come, they were all with one accord in one place. And suddenly there came a sound from heaven as of a rushing mighty wind, and it filled all the house where they were sitting. And there appeared unto them cloven tongues like as of fire, and it sat upon each of them. And they were all filled with the Holy Ghost, and began to speak with other tongues, as the Spirit gave them utterance.
And so as curiousdannii said; the Father, the Son, and the elect Angels are watching from Heaven as the Holy Spirit is here being our comforter and teacher.
Hope this helps.