#INVALID DATA TYPE

Hi
Im using the formula =IF(YEAR([Expected project completion date]@row) = 2024, WEEKNUMBER([Expected project completion date]@row), "")
If the cell "expected completion date" is blank I get #INVALID DATA TYPE. is there a way to remove this and just have the cell blank?
Thanks
Answers
-
Hi @pmolloy,
Try wrapping the formula in an "IFERROR" function.
=IFERROR(IF(YEAR([Expected project completion date]@row) = 2024, WEEKNUMBER([Expected project completion date]@row), ""), "")
Hope this helps,
Dave
-
I replicated this and got it to work by changing 2024 to "2024". If I omit the date then it's blank. Might help!
=IF(YEAR([Expected project completion date]@row) = "2024", WEEKNUMBER([Expected project completion date]@row), "")
Alternatively this works too.
=IFERROR(IF(YEAR([Expected project completion date]@row) = "2024", WEEKNUMBER([Expected project completion date]@row)), "")
-
Wow that works perfectly.
Thank you for all your help
-
Help Article Resources
Categories
Check out the Formula Handbook template!