Reputation: 4539
I have the following data in columns:
A B
1 1/08/2021 29/11/2021
These values are the result of some searches from other columns with this formula:
=MINIFS('sheet2'!$G:$G,'sheet2'!$F:$F,$E1)
Both the source cells and the resulting cells are of type date
I then look to get the DATEDIF
between these and I end up with #NAME?
=DATEDIF($A1,$B1,”M”) /* Corrected the above "W" to "M"... typo! */
I tried DATEVALUE
on the search result cells like this:
=DATEDIF(DATEVALUE($A1),DATEVALUE($B1),”M”)
But I end up with #VALUE?
so the resulting values from the searches are not seen as dates. What have I missed? Thanks!
Upvotes: 1
Views: 54
Reputation: 60224
You have two mistakes:
The #NAME?
error is because you are using left and right quotation marks instead of straight quotation marks. eg: “W”
instead of "W".
If you correct that, you will see a #NUM!
error because W
is not a valid argument for the function.
See MS Help for the DATEDIF
function for more information as well as a warning about the MD
unit.
Upvotes: 0
Reputation: 1134
The "W" on =DATEDIF($A1,$B1,”W”)
is not a valid unit, accordingly to Microsoft's documentation (here).
The list of valid units is:
Upvotes: 1