Data usage for a specific start date of the month

My data billing starts on the 20th and I have tried the following formula but I get inaccurate results. Can someone please help?

$if(df(d) <20, ts(mt, A, 20dr1M), ts(mt, A, 19d))$

My phones internal system gives me the correct information however with the above formula I get an incorrect value. At the moment it is out by 2gb.