This can be one way if I understood your question.
Create a variable for calculating end of month of Start Date:
v_eom_start_date=LastDayOfMonth([Started])
Similarly for end date
Calculate the day number :end_Date =DayNumberOfMonth([Ended])
Now: Do the days between
var1=Daysbetween([Started];v_eom_start_date)
The above two variables gives you the number of days used in that month
Now do var1*24*60
end_Date*24*60