View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
joeu2004 joeu2004 is offline
external usenet poster
 
Posts: 2,059
Default Complex IF OR AND Statement

PS.... On Oct 30, 1:30*am, joeu2004 wrote:
=G2*MAX(0,1+MIN(Y2,DATE(2009,7,31))-MAX(X2,DATE(2009,7,1)))/31

[...or...]
=G2*MAX(0,1+MIN(Y2,AA2)-MAX(X2,Z2))/(AA2-Z2+1)


If you would like those to work even when X2 or Y2 is empty or appears
blank, change X2 to N(X2) and Y2 to N(Y2). For example:

=G2*MAX(0,1+MIN(N(Y2),DATE(2009,7,31))-MAX(N(X2),DATE(2009,7,1)))/31