# Help in this formula ... calculating difference of dates

#### tanwarrahul1988

##### Member
Hello Guys
i have a issue in calculating date

Like if in D5 write 2 then in D2 its shows 2
But if in D4 i write Date then in D2 calculate the difference of date. For example i attach the file

#### Attachments

• Book1.xlsx
9.5 KB · Views: 8
i mention this formula in D2 but its not working when i write date in D4

=IF(ISNUMBER(D5), D5, IF(ISDATE(D4), DATEDIF(TODAY(), D4, "D"), ""))

Can You send a situation - when You have some challenges?

I already shared the file in attachment

... situation ... You ... challenges
Or
where do You have challenges with that file?
... name that/those cells?

Value change in A7 when we type in D4 either in D5

Okay ...
I type 12/04/2024 in D4
>>> A7 is 12/04/2024
I type 3 in D5
>>> A7 is 12/04/2024
Noted:
# cell D5 is totally separate cell with any formulas.
# cell D3 - for some reason someone would like to use "0" (text) instead of 0 (zero)
... if You would like to use text there ... then format that cell as text

What kind of challenge do You have?

Thanks, I got the solutions with my R&D formula. And thanks for your help

=IF(ISNUMBER(D5), D5, IF(ISNUMBER(D4), TODAY()-D4, "0"))

but I had to delete D3 formula which was waste