Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default set a minimum value for a cell

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
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.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default set a minimum value for a cell

hi
post your formula please.

Regards
FSt1

"Nevets" wrote:

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.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default set a minimum value for a cell

Assuming C13 is the "on-site" time, and D13 is the "off-site" time, and
E13 is a cell whose formula is =D13-C13, and
F13 is a cell with prep/travel time I enter depending on the location of the
event.
My formula in the cell used to figure out how many hours to charge is:
=F13+(E13-INT(E13))*24
What I need is something that will put a minimum of 4 hrs in the E13 cell,
but it needs to be formatted in the same way as the other values in that cell
(i.e. 4 hrs actually will equal 0.16667, since that value x 24 hrs = 4 hrs)

"FSt1" wrote:

hi
post your formula please.

Regards
FSt1

"Nevets" wrote:

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.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default set a minimum value for a cell

Take your pick:

=IF(COUNT(C13:D13)=2,MAX(4/24,D13-C13),0)

=IF(COUNT(C13:D13)=2,MAX(TIME(4,,),D13-C13),0)

--
Biff
Microsoft Excel MVP


"Nevets" wrote in message
...
Assuming C13 is the "on-site" time, and D13 is the "off-site" time, and
E13 is a cell whose formula is =D13-C13, and
F13 is a cell with prep/travel time I enter depending on the location of
the
event.
My formula in the cell used to figure out how many hours to charge is:
=F13+(E13-INT(E13))*24
What I need is something that will put a minimum of 4 hrs in the E13 cell,
but it needs to be formatted in the same way as the other values in that
cell
(i.e. 4 hrs actually will equal 0.16667, since that value x 24 hrs = 4
hrs)

"FSt1" wrote:

hi
post your formula please.

Regards
FSt1

"Nevets" wrote:

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.





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default set a minimum value for a cell

a1= start time 08:00
b1 = end time 12:00
d1 = 4:00
all formatted as [hh]:mm

formula
=MAX(B1-A1,$D$1)

will return the maximum of the time difference and 4 hrs. Its best to keep
the 4hr constant in a cell in case you want to change it in which case you
only alter a single cell.

Mike

"Nevets" wrote:

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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to lookup the minimum, 2nd minimum and 3rd minimum......... Mark McDonough Excel Worksheet Functions 8 July 15th 06 09:39 PM
Seting the minimum value in a cell [email protected] Excel Worksheet Functions 6 July 8th 06 12:40 PM
cell minimum value of zero ? JcR Excel Discussion (Misc queries) 1 June 7th 06 05:10 PM
Maximum and minimum cell value sharkfoot Excel Discussion (Misc queries) 3 March 5th 06 11:08 PM
How can I set a minimum value of zero or -100% in a cell? David Drennan Excel Worksheet Functions 6 January 6th 06 11:27 AM


All times are GMT +1. The time now is 02:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"