Forum Discussion
Calculate the difference between 2 dates
- 9 years ago
- 9 years ago
RvdHeijden wrote:it states that in DATEDIFF function, the start date cannot be greater than the end date
If you used my formula you should not be getting this error!
See picture...
if start before end +
if end before start -
If both are blank you get zero
if either one is blank you get blank
But no you can mix text and number data types in the same column!
(meaning you can't get numbers when the data is there and then text when its not - but you will get blanks or zero)
Hope this helps!
Good Luck! :smileyhappy:
- RvdHeijden9 years agoPost Prodigy
Another question because your formula works if both dates have values.
The formula returns an error it seems if one of the 2 dates are empty.
it states that in DATEDIFF function, the start date cannot be greater than the end date
How should i edit the formula so that if one of the 2 dates are empty it returns a value like 'missing data' or something like that ?
- Sean9 years agoCommunity Champion
RvdHeijden wrote:it states that in DATEDIFF function, the start date cannot be greater than the end date
If you used my formula you should not be getting this error!
See picture...
if start before end +
if end before start -
If both are blank you get zero
if either one is blank you get blank
But no you can mix text and number data types in the same column!
(meaning you can't get numbers when the data is there and then text when its not - but you will get blanks or zero)
Hope this helps!
Good Luck! :smileyhappy:
- RvdHeijden9 years agoPost Prodigy
Sean i copied this formula in another colum and changed the colums for the formula, nothing else but it still reads as an #ERROR.
In DATEDIFF function, the start date cannot be greater than the end date
The new colums only have date values and no tekst
DATEDIFF Hersteltijd =
SWITCH (
TRUE ();
Tickets[Monteur gearriveerd] < Tickets[Technisch gereed]; DATEDIFF ( Tickets[Technisch gereed]; Tickets[Monteur gearriveerd]; MINUTE );
Tickets[Technisch gereed] > Tickets[Monteur gearriveerd]; DATEDIFF ( Tickets[Monteur gearriveerd]; Tickets[Technisch gereed]; MINUTE ) * -1;
0
)