The single word that encapsulates the feeling of both happiness and sadness is "bittersweet." It describes an emotion that combines elements of joy and sorrow at the same time.