Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
R R is offline
external usenet poster
 
Posts: 6
Default How is time represented? How do i make an equation representing 5 minutes?

Fist off, big thanks to Chip Pearson who answered my last querry here
with a pointer to his site-- great stuff there, thanks!

Here is my next problem-- simple I am sure, but i haven't a clue...

In Cell e1 I have a time, in one of the standard time formats. I need
to run some code if the current time is at least 5 minutes later than
the time in e1.

The IF, THEN statement seems obvious enough, but what goes in the
place of the question marks below? Does each numeral equal a second,
so for 5 minutes it would be 60*5, or 300? Apparently not, 300 doesn't
= 5 minutes I have fingured out through trial and error.... So what
should go in place of the question marks below to equal 5 minutes??
Arggg!!!! Thanks in advance for the help and/or explanation!

If (Now() (e1 + ????)) Then
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How is time represented? How do i make an equation representing 5 minutes?

Hi R,

1 Day = 24 Hours
1 Hour = 60 Mins

Therefo

5 Mins = (1/24/60)*5

---
Regards,
Norman



"R" wrote in message
...
Fist off, big thanks to Chip Pearson who answered my last querry here
with a pointer to his site-- great stuff there, thanks!

Here is my next problem-- simple I am sure, but i haven't a clue...

In Cell e1 I have a time, in one of the standard time formats. I need
to run some code if the current time is at least 5 minutes later than
the time in e1.

The IF, THEN statement seems obvious enough, but what goes in the
place of the question marks below? Does each numeral equal a second,
so for 5 minutes it would be 60*5, or 300? Apparently not, 300 doesn't
= 5 minutes I have fingured out through trial and error.... So what
should go in place of the question marks below to equal 5 minutes??
Arggg!!!! Thanks in advance for the help and/or explanation!

If (Now() (e1 + ????)) Then



  #3   Report Post  
Posted to microsoft.public.excel.programming
R R is offline
external usenet poster
 
Posts: 6
Default How is time represented? How do i make an equation representing 5 minutes?

Hmmm, thanks Norman, but maybe I am missing something!

When I plug that in, or (.003472222) the If, THEN doesn't work at all.
If in E1 I have "Oct 7, 2004 11:10 pm" and I use:

If (Now() (e1 + (.003472222)) Then Do xyz

It will do xyz even if the time NOW() = "Oct 7, 2004 11:12"

I need it to only do xyz if the time is 5 minutes later than E1, or
AFTER "Oct 7, 2004 11:15 pm" in this example....

Sorry if I am thick trying to figure this out, I am pretty new to VBA
and am honsetly kind of lost here.


On Fri, 8 Oct 2004 03:54:58 +0100, "Norman Jones"
wrote:

Hi R,

1 Day = 24 Hours
1 Hour = 60 Mins

Therefo

5 Mins = (1/24/60)*5

---
Regards,
Norman



"R" wrote in message
.. .
Fist off, big thanks to Chip Pearson who answered my last querry here
with a pointer to his site-- great stuff there, thanks!

Here is my next problem-- simple I am sure, but i haven't a clue...

In Cell e1 I have a time, in one of the standard time formats. I need
to run some code if the current time is at least 5 minutes later than
the time in e1.

The IF, THEN statement seems obvious enough, but what goes in the
place of the question marks below? Does each numeral equal a second,
so for 5 minutes it would be 60*5, or 300? Apparently not, 300 doesn't
= 5 minutes I have fingured out through trial and error.... So what
should go in place of the question marks below to equal 5 minutes??
Arggg!!!! Thanks in advance for the help and/or explanation!

If (Now() (e1 + ????)) Then



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How is time represented? How do i make an equation representing 5 minutes?

Hi R,

In VBA. try:

If Now Range("E1").Value + TimeSerial(0, 5, 0) Then


---
Regards,
Norman



"R" wrote in message
...
Hmmm, thanks Norman, but maybe I am missing something!

When I plug that in, or (.003472222) the If, THEN doesn't work at all.
If in E1 I have "Oct 7, 2004 11:10 pm" and I use:

If (Now() (e1 + (.003472222)) Then Do xyz

It will do xyz even if the time NOW() = "Oct 7, 2004 11:12"

I need it to only do xyz if the time is 5 minutes later than E1, or
AFTER "Oct 7, 2004 11:15 pm" in this example....

Sorry if I am thick trying to figure this out, I am pretty new to VBA
and am honsetly kind of lost here.


On Fri, 8 Oct 2004 03:54:58 +0100, "Norman Jones"
wrote:

Hi R,

1 Day = 24 Hours
1 Hour = 60 Mins

Therefo

5 Mins = (1/24/60)*5

---
Regards,
Norman



"R" wrote in message
. ..
Fist off, big thanks to Chip Pearson who answered my last querry here
with a pointer to his site-- great stuff there, thanks!

Here is my next problem-- simple I am sure, but i haven't a clue...

In Cell e1 I have a time, in one of the standard time formats. I need
to run some code if the current time is at least 5 minutes later than
the time in e1.

The IF, THEN statement seems obvious enough, but what goes in the
place of the question marks below? Does each numeral equal a second,
so for 5 minutes it would be 60*5, or 300? Apparently not, 300 doesn't
= 5 minutes I have fingured out through trial and error.... So what
should go in place of the question marks below to equal 5 minutes??
Arggg!!!! Thanks in advance for the help and/or explanation!

If (Now() (e1 + ????)) Then





  #5   Report Post  
Posted to microsoft.public.excel.programming
R R is offline
external usenet poster
 
Posts: 6
Default How is time represented? How do i make an equation representing 5 minutes?

Wow!!! Perfect!! Thanks so much Norman-- really mega thanks, you have
no idea how much i appreciate your help! It works, it works!! YEAH!!!

On Fri, 8 Oct 2004 04:44:14 +0100, "Norman Jones"
wrote:

Now Range("E1").Value + TimeSerial(0, 5, 0)


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
make chart based on equation Daniel Charts and Charting in Excel 7 August 12th 07 03:33 PM
Formula to find Stop Time from Start Time and Total Minutes Jonathan Bickett Excel Worksheet Functions 5 March 7th 07 05:22 PM
calculating timesheet, time-in/time-out = total hours & minutes, . Steve Lindsay Excel Worksheet Functions 13 November 8th 06 03:45 PM
How to make one column be the result of an equation between two dcnguyen New Users to Excel 7 January 9th 06 12:28 AM
Using military time but with 100 minutes not 60 minutes srwamp Excel Discussion (Misc queries) 7 November 21st 05 09:41 AM


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