vendredi 17 avril 2020

If statement for days between dates not working

I'm trying to work out how much revenue is attributed to each month based on a Revenue figure (e.g. £500) and a start and end date (e.g. 01/01/2020 - 13/02/2020).

The only way I can work out how to do this is to work out the number of days between the two dates, divide the revenue by that number of days, and then work out how many of the days fall in each month.

To do this I've used the formula:

IF({Start Month}="January-20", DATETIME_DIFF({Start Date}, 31/01/20, 'days'), "0")

The idea being is that if the start date is in January 2020, this formula will return the number of days between the start date and the end of the month (31/02/20), thus showing the number of days to attribute revenue to.

However for some reason when the start date is 2/1/2020, this formula returns '18262'.

What's happening here?

screenshot of issue

Aucun commentaire:

Enregistrer un commentaire