Forum Discussion
NRW_admin1
10 years agoNew Member
Nested IF and DATEDIFF formulas when some date fields are blank
I would like to count the number of days between two date fields: 'datereceived' and 'datedulymade'. I tried to use the DATEDIFF function, BUT - some of the corresponding dates are the same (e.g. num...
Greg_Deckler
Community Champion
10 years agoPerhaps use ISBLANK in your IF statement to check for that boundary condition?
https://msdn.microsoft.com/en-us/library/ee634204.aspx
- Sean10 years ago
Community Champion
NRW_admin1 You can use DATEDIFF when the dates are the same (see picture below) but you can't have blanks or negative values (to deal with negatives see link at the bottom)
Num of Days = IF ( ISBLANK ( 'Table'[Made] ), BLANK (), DATEDIFF ( 'Table'[Received], 'Table'[Made], DAY ) )Also see response here... (although this doesn't deal with Blank may give some ideas)
- NRW_admin110 years agoNew Member
Problem solved, combined with guidance in the link. Many thanks :)
- Eric_Zhang10 years ago
Microsoft Employee
NRW_admin1
It is great to hear the problem got solved.It would be greatly appreciated of you if you can post the solution and accepting it as solution can help the people who would have the same problem to find the answer quickly. :)