Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Simple function made difficult

Bare with me on this one...I simply need to subtract A1 from A2 and have the
value appear in A3. All three cells are formatted as TIME.

Here comes the complicated part.

Before subtracting A1 from A2, I need to first calculate the values of A1
and A2 using the following functions within cell A3:

MOD(INT((A1+TIME(0,7,0))*24*4)/24/4,1)
MOD(INT((A2+TIME(0,7,0))*24*4)/24/4,1)

Then all I need to do is subtract A1 from A2.

Example

A1 = 5:33 AM
A2 = 3:09 PM

without the MOD function A2-A1 = 9:36
With the MOD function A2-A1 = 9:45

How can I incorporate the MOD function in cell A3 which already contains
=A2-A1 ?






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default Simple function made difficult

this, in a3, doesn't work?

=MOD(INT((A2+TIME(0,7,0))*24*4)/24/4,1)-MOD(INT((A1+TIME(0,7,0))*24*4)/24/4,1)

--


Gary


"GreenMonster" wrote in message
...
Bare with me on this one...I simply need to subtract A1 from A2 and have
the value appear in A3. All three cells are formatted as TIME.

Here comes the complicated part.

Before subtracting A1 from A2, I need to first calculate the values of A1
and A2 using the following functions within cell A3:

MOD(INT((A1+TIME(0,7,0))*24*4)/24/4,1)
MOD(INT((A2+TIME(0,7,0))*24*4)/24/4,1)

Then all I need to do is subtract A1 from A2.

Example

A1 = 5:33 AM
A2 = 3:09 PM

without the MOD function A2-A1 = 9:36
With the MOD function A2-A1 = 9:45

How can I incorporate the MOD function in cell A3 which already contains
=A2-A1 ?








  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Simple function made difficult

One way:

=FLOOR(A2+7/1440,1/96) - FLOOR(A1+7/1440,1/96)

or, with one less math operation

=(FLOOR(A2*1440+7,15) - FLOOR(A1*1440+7,15))/1440



In article ,
"GreenMonster" wrote:

Bare with me on this one...I simply need to subtract A1 from A2 and have the
value appear in A3. All three cells are formatted as TIME.

Here comes the complicated part.

Before subtracting A1 from A2, I need to first calculate the values of A1
and A2 using the following functions within cell A3:

MOD(INT((A1+TIME(0,7,0))*24*4)/24/4,1)
MOD(INT((A2+TIME(0,7,0))*24*4)/24/4,1)

Then all I need to do is subtract A1 from A2.

Example

A1 = 5:33 AM
A2 = 3:09 PM

without the MOD function A2-A1 = 9:36
With the MOD function A2-A1 = 9:45

How can I incorporate the MOD function in cell A3 which already contains
=A2-A1 ?

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
I made a simple spreadsheet on Excel and it says its 34MB. How? pugpink Excel Discussion (Misc queries) 1 December 4th 09 06:52 PM
Simple Game and Puzzle - Very Difficult to Implement dmb490 Excel Worksheet Functions 1 July 19th 06 10:19 PM
Simple Calculation - but Difficult! [email protected] Excel Discussion (Misc queries) 1 August 18th 05 10:16 AM
Very simple, but difficult formula question pugsly8422 Excel Worksheet Functions 4 July 7th 05 03:14 PM
URGENT.....Simple problem...made hard?? GeoffM[_3_] Excel Programming 0 May 11th 04 07:36 AM


All times are GMT +1. The time now is 11:29 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"