# DDIFF between due dates on two tasks

Hi there!

I'm struggling with a formula in Wrike Analyze - I am trying to show the day difference between two due dates (Task A and Task B). To mark the dates I want to calculate from, I have created custom date fields.
In the example below I am trying to show how much time passed between the kick-off of the project to the platform demo. I can see in my pivot that I have these fields available for my relevant tasks with dates filled out but the formula below is not returning any results:

I'm sure it's something simple I'm missing - I'd appreciate any suggestions :)

0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos
2 commenti

Hi there Kate Brozda !

I asked a similar question in regards to due dates. This was the formula someone sent me and it worked great. It's not exactly what you're doing, but I think the concept is the same or similar. You can read the other thread here. I hope it helps you!

0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos

Hi Kate Brozda,
This is (surprisingly?) difficult to do. You'll need do two separate comparisons and then combine them together. It will probably look something like this:

`(MAX(DDIFF(NOW([Days in Task Due Date]), [Days in Task Due Date])), [VM Kickoff (Task Name?)])- (MAX(DDIFF(NOW([Days in Task Due Date]), [Days in Task Due Date])), [VM Site Demo (Task Name?)])`

What this formula does is compares Today's date (the NOW function) to the Due Date of the VM Kickoff task, and then subtracts that value from the comparison of Today's date to the VM Site Demo task.

For an example. Lets say today is the 1st, tomorrow is the VM Kickoff (the 2nd), and then the Site Demo is the 4th. The calculations would be the first DDIFF (-1) minus the second DDIFF (-3). (-1) - (-3) is 2, which is correct. Try it with other dates on a piece of paper, the math checks out.

The only thing is that you need someway to filter the first and second functions to ensure your DDIFF is only getting the one task you want in each expression. For this, we make use of the FILTER function, that looks like this:

`(<Value>, <Filter 1>, (<Filter 2>),...)`

Where the first item is the value to calculate, and the second (or more) item is the filter you want to use. You'll see in my original formula, I have a filter after the DDIFF expression where I input the VM Kickoff Task Title. This works if every Kickoff task has the exact same title. If they don't have the same title, I'd recommend creating a Custom Field that you can put on every Kickoff task to properly identify it for reporting purposes, and then use that field as your filter.

I know that was a lot, please let me know if you have any more questions!

Mark Tapia Community Team at Wrike Wrike Product Manager Conosci le straordinarie funzionalità di Wrike e le best practices

Mark Tapia Wrike Team member Conosci le straordinarie funzionalità di Wrike e le best practices

0
👍 Spot On 💡 Innovative Approach 💪 Stellar Advice ✅ Solved 🪄 Remove Kudos

Folllowing List for Post: DDIFF between due dates on two tasks
[this list is visible for admins and agents only]

Su