PQE formula using AND & OR

mikeymay

Well-known Member
Joined
Jan 17, 2006
Messages
1,457
I am struggling to get the following formula to work when adding a column in the PQE
= if ([Theoretical Next Visit] = "" or [Theoretical Next Visit] < DateTime.LocalNow) and ([Next Visit] <> "" or [Next Visit] >= DateTime.LocalNow) then 1 else 0

Could somebody point out where this isn't working?

TIA
 
Last edited:

Some videos you may like

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Ozeroth

Active Member
Joined
Dec 14, 2013
Messages
264
Two problems I can see:

  • DateTime.LocalNow should be DateTime.LocalNow()
  • Rather than comparing datetime values with the empty string "", you may want to compare with null instead. It seems that this doesn't cause an error, but a datetime value will never be equal to ""

Regards,
Owen
 

Watch MrExcel Video

Forum statistics

Threads
1,109,250
Messages
5,527,631
Members
409,778
Latest member
MagalieD

This Week's Hot Topics

Top