# Daily Spend Average

Hi there. I’m creating a very simple expense tracker app for travel. I’m trying to figure out how to calculate the average of how much I’m spending per day. It would be based on the day that the trip starts and on the current day it is.

Can you go into more details on this? Do you mean that is the duration you want to take into account?

Assuming you can plan multiple trips on the app, you should have a Trips table with a rowID, and an Expenses table that stores multiple entries that contains a trip ID for relation purposes.

In the Trips table, from the relation to the Expenses table, create a rollup to sum the amount of money you have spent for said trip.

Then in the Trips table, you also would have a “Start Date” column and an “End Date” column. Use a math column with the formula:

A/MIN(TRUNC(N-S,0),TRUNC(E-S,0))

with A being the amount you have spent, N being the “Now” time and S being the “Start Date” value. The MIN function will calculate the number of days that has passed from the start date until now, with a stop being put on the “End Date”. Then divide A by that amount of days.

2 Likes