If/Then equation trouble

Hi, 

 

I'm trying to build an if - then formula but cannot get it to work. 

I want to calculate the Current weight if the Total gram is not blank AND the Use Before Date is later than today. 

The current weight is calculated as Total gram - Used gram. 

If either the Total gram is blank or the Use Before Date has passed the current weight should be 0

 

How should I build this formula?