Share via

IF(DATEVALUE) returning #VALUE!

Anonymous
2019-02-04T19:02:23+00:00

Hello,

I am using the following formula for cell H4: 

=IF(DATEVALUE(G4), E4*25%)

when a date is entered (in G4),  the amount in E4 is divided by 25 per cent. When there is no date there, it is returning, #VALUE! is there a way of replacing that #VALUE! with a 0 or blank?

Many thanks,

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Anonymous
    2019-02-05T00:15:13+00:00
    1. Do not put quotes around 0 (zero) if your intent is return a numeric value (which E4*25% is).
    2. As I explained, DATEVALUE returns #VALUE if G4 contains a numeric date, as well as any text that is not recognized as a date.  Is that really your intent?(!).

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2019-02-04T22:16:23+00:00

    Hello,

    I fixed it using the formula:

    =IFERROR(IF(DATEVALUE(G4), E4*25%),"0")

    I'm trying to get a lot better at excel, it's a lot of fun!

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2019-02-04T21:08:21+00:00

    Ostensibly:

    =IF(ISNUMBER(DATEVALUE(G4)), E4*25%, "")

    But I suspect that you really want:

    =IF(G4="", "", E4*25%)

    The issue is:  when does DATEVALUE return #VALUE, and what do you mean by "date is entered"?

    DATEVALUE returns a numeric value ("date serial number") only if G4 contains text that Excel recognizes as a date.

    But usually, when we enter something that Excel recognizes as a date, it is converted to a numeric "date serial number", which is formatted as a date.

    In that case, DATEVALUE returns #VALUE because the value in G4 is numeric, not text.  I suspect, that is not the (intended) cause of the #VALUE result that you see.

    Was this answer helpful?

    0 comments No comments
  4. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more