YOU SAID:
having a friend over and getting sad when they leave made me realize how lonely I was
INTO JAPANESE
友達がいて、彼らが去るときに悲しくなると、私がどれほど孤独であるかを実感しました
BACK INTO ENGLISH
I felt how lonely I was when I was sad when I had friends and they left
INTO JAPANESE
友達がいて、彼らが去ったときに悲しかったとき、私はどれほど孤独だったかを感じました
BACK INTO ENGLISH
I felt how lonely when I had friends and they were sad when they left
INTO JAPANESE
友達ができて寂しくなり、彼らが去ったときは悲しかった
BACK INTO ENGLISH
I missed my friends and they were sad when they left
INTO JAPANESE
友達がいなくて寂しかった
BACK INTO ENGLISH
I missed my friend
INTO JAPANESE
友達がいなくて寂しかった
it is unlikely that this phrase will ever reach equilibrium