Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Lee
 
Posts: n/a
Default Problem with formula =MAX(A1-40,0)

I was using the formula =MAX(A1-40,0) to seperate overtime hours from total
hours worked on a time sheet. The cell was formatted "general". Now I need to
format the cells "[h]:mm" but the formula no longer works with that cell
formatting. Is there a fix?
--
Lee Davenport
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default Problem with formula =MAX(A1-40,0)

Try:

=MAX(A1-1.66666667,0)

As re-formatted 24 hrs = 1 day
so
40 hrs = 1.6666667 days
--
Gary's Student


"Lee" wrote:

I was using the formula =MAX(A1-40,0) to seperate overtime hours from total
hours worked on a time sheet. The cell was formatted "general". Now I need to
format the cells "[h]:mm" but the formula no longer works with that cell
formatting. Is there a fix?
--
Lee Davenport

  #3   Report Post  
Posted to microsoft.public.excel.misc
David Benson
 
Posts: n/a
Default Problem with formula =MAX(A1-40,0)

Lee,

You have run afoul of Microsoft's convention for displaying times and dates.

When you tell Excel that a cell contains a date or time, then Excel assumes
that the integer (whole-number) part of the value of the cell represents the
day (where Day 1 is Jan. 1, 1900). The fractional part of the value of the
cell represents the time, expressed as a fraction of a 24-hour day.

When you converted a cell containing the value "41" to date and time, Excel
assumed that the value meant midnight on February 10, 1900, which is 41 days
after Jan. 1, 1900. If you converted a cell containing the formula you gave
below, then Excel interpreted as midnight of some other day, the exact day
being determined by the number of overtime hours.

Change your formula to this:

=MAX((A1-40)/24,0)

Note that Cell A1 will have to contain a time in hours and fractions of an
hour. For example, if someone worked 41-1/2 hours, you would have to enter
"41.5" in Cell A1.

Hope this helps.


-- David Benson


"Lee" wrote in message
...
I was using the formula =MAX(A1-40,0) to seperate overtime hours from total
hours worked on a time sheet. The cell was formatted "general". Now I need
to
format the cells "[h]:mm" but the formula no longer works with that cell
formatting. Is there a fix?
--
Lee Davenport



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
formula percentage problem thinkpic New Users to Excel 4 November 2nd 05 09:04 PM
formula problem Bart New Users to Excel 4 October 21st 05 01:56 PM
Problem with nested logical formula. Bill R Excel Worksheet Functions 6 September 26th 05 05:36 AM
problem with Array Formula OrdOff Excel Worksheet Functions 2 June 30th 05 05:57 PM
Problem with VBA returning the contents of a long formula. [email protected] Excel Discussion (Misc queries) 2 February 23rd 05 01:14 AM


All times are GMT +1. The time now is 08:28 AM.

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"