Share via

IF function with AND and DATEVALUE

Anonymous
2024-08-03T19:32:37+00:00

I am trying to use the IF function with AND and DATEVALUE. I finally got all the errors resolved but I am not getting the correct result. Here is my formula: =(IF(AND(I4>=DATEVALUE("8/3/2024"), I4<=("8/5/2024")), +(0), +(50))). I am getting the last result (50) no matter what date is is field I4. Can you tell me what I'm doing wrong?

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

1 answer

Sort by: Most helpful
  1. HansV 462.6K Reputation points
    2024-08-03T20:21:29+00:00

    How about

    =IF(AND(I4>=DATE(2024, 8, 3), I4<=DATE(2024, 8, 5)), 0, 50)

    or

    =((I4<DATE(2024, 8, 3))+(I4>DATE(2024, 8, 5)))*50

    Was this answer helpful?

    0 comments No comments