Only two Enegy values, claculating the other ones?

Hey Guys!

I am really struggling with the Energy dashboard.
My problem is, that I own a solar system and i have two values from it, first the whole energy used by the house and second the produced energy.
Homeassistant requires me to enter the produced value the “back to the grid” value and the “from the grid” value.
My solution is to calculate the values.
“back to the grid” value = produced energy - used energy
“from the grid” value = used energy - produced energy

I am really not sure how to do that, does anyone?
Thanks!