View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
[email protected] revinfo@mewbourne.com is offline
external usenet poster
 
Posts: 8
Default Using a logical test on a date is failing

On Mar 22, 10:44 am, Les Thompson <Les
wrote:
We have a situation where a date is entered into a cell. If that date is
before a trigger date, billing will apply from the trigger date. If that
date is after the trigger date, then billing will apply from that date.

Try this instead:

=IF(H8<1/1/7,DATE(2007,1,1),H8)


Bruce

Example: H8 = 12/7/06
Trigger Date = 1/1/07

Formula is =if(H8<1/1/7,1/1/7,H8)

Since H8 in this example is 12/7/06 the trigger date of 1/7/07 should be
used but it fails the test and returns the actual contents of H8 which is
12/7/06 instead. Why?

The serial number of 12/7/06 39058 and the serial number of 1/1/07 is 39083.

In my muddled brain, 39058 is less than 39083 and therfore the formula
should return 1/1/7 but it does not. What am I missing here?