View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default set a minimum value for a cell

Try something like this:

A1 = start
B1 = end

=IF(COUNT(A1:B1)=2,MAX(4,B1-A1),"")

--
Biff
Microsoft Excel MVP


"Nevets" wrote in message
...
I have a sheet with two times, and a formula to figure out how much to
charge, depending on the difference between those two times. I would like
to
set a minimum of 4 hours, such that no matter what two times are entered,
if
they are less than four hours apart, the result will be 4 hours, but if
they
are anything more than 4 hours apart, the result will be the actual
difference.