Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default using if statement to subtract 24 hours from time

Hi all

I am trying to subtract 24 hours from a time if it is actually over 24 hours, if not then show 0

my formula works for everthing over 24 hours but can't get it show a 0 or under 24 hours.

In A1 8/3/2008 7:21

in B1 8/6/2088 15:36

in C1 I have =if(("B1-A1")(A1+"1"),(B1-A1)-"1",0)

The answer is 56:15:00 which is what I want but if B1 is 8/3/2008 it is showing ##### indicating a negative time number

instead of 0

any help would be appreciated

Richard
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 66
Default using if statement to subtract 24 hours from time

Dear Richard,

Try =IF(F27-F26<0,0,F27-F26)

HTH


"richard.littlewing" wrote:

Hi all

I am trying to subtract 24 hours from a time if it is actually over 24 hours, if not then show 0

my formula works for everthing over 24 hours but can't get it show a 0 or under 24 hours.

In A1 8/3/2008 7:21

in B1 8/6/2088 15:36

in C1 I have =if(("B1-A1")(A1+"1"),(B1-A1)-"1",0)

The answer is 56:15:00 which is what I want but if B1 is 8/3/2008 it is showing ##### indicating a negative time number

instead of 0

any help would be appreciated

Richard

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 793
Default using if statement to subtract 24 hours from time

Try =IF(B1-A11,B1-1,0)

This will subtract 24 hours (1 day) from B1 (replace with A1 if you want to
reduce that by one day) if the difference is more than 24 hours otherwise it
will retrun zero.

btw in one of the dates you typed 2088... not 2008.

"richard.littlewing" wrote:

Hi all

I am trying to subtract 24 hours from a time if it is actually over 24 hours, if not then show 0

my formula works for everthing over 24 hours but can't get it show a 0 or under 24 hours.

In A1 8/3/2008 7:21

in B1 8/6/2088 15:36

in C1 I have =if(("B1-A1")(A1+"1"),(B1-A1)-"1",0)

The answer is 56:15:00 which is what I want but if B1 is 8/3/2008 it is showing ##### indicating a negative time number

instead of 0

any help would be appreciated

Richard

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 do I subtract 8 business hours from a date/time value? drew Excel Discussion (Misc queries) 5 July 7th 08 02:33 PM
Subtract hours from a time and get the correct time casey Excel Worksheet Functions 1 June 22nd 08 08:41 PM
How do you subtract time as in a timecard to calculate hours work Dave Davis Excel Worksheet Functions 2 September 18th 06 05:58 PM
Time/Date subtract 24 hours ET902 Excel Discussion (Misc queries) 4 September 12th 06 02:47 PM
Subtract time between certain days/work hours? lisa b. Excel Worksheet Functions 2 July 17th 06 09:26 PM


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

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

About Us

"It's about Microsoft Excel"