Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 34
Default now function

I got a cell A1 with a now function =now() which gives the current time.
Cell A2 has a time that is entered, and cell A3 has an if function that
compared if(A1A2,"","Do Something"). However, the if statement is true all
the time even if the time is cell A2 is a later time than A1. I changed the
format in cell A1 from a time format to a general and it turn out to be a
big number. Otherwise, I changed the time format in cell A2 into general
and it is a very small decimal number. How do I get around this, may with a
mod function or something?


  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,058
Default now function

NOW gives both the date and the time. in A1:

=NOW()-INT(NOW())
--
Gary''s Student - gsnu200732


"Richard" wrote:

I got a cell A1 with a now function =now() which gives the current time.
Cell A2 has a time that is entered, and cell A3 has an if function that
compared if(A1A2,"","Do Something"). However, the if statement is true all
the time even if the time is cell A2 is a later time than A1. I changed the
format in cell A1 from a time format to a general and it turn out to be a
big number. Otherwise, I changed the time format in cell A2 into general
and it is a very small decimal number. How do I get around this, may with a
mod function or something?



  #3   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.excel.newusers
external usenet poster
 
Posts: 140
Default now function

Hi Richard

In testing your example
A1 = Now() - Returns Date/Time
Using the same custom format for A1 in A2 - dd/mm/yyyy hh:mm

Using the If formula - IF(A1A2,TRUE, FALSE)
works every time

Is it possible the the format of Cell A2 might be affecting the calculation?

"Richard" wrote:

I got a cell A1 with a now function =now() which gives the current time.
Cell A2 has a time that is entered, and cell A3 has an if function that
compared if(A1A2,"","Do Something"). However, the if statement is true all
the time even if the time is cell A2 is a later time than A1. I changed the
format in cell A1 from a time format to a general and it turn out to be a
big number. Otherwise, I changed the time format in cell A2 into general
and it is a very small decimal number. How do I get around this, may with a
mod function or something?



  #4   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,202
Default now function

NOW gives both the date and the time. in A1:

=NOW()-INT(NOW())


Or even... =NOW()-TODAY()

Rick
  #5   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,886
Default now function

Or even... =NOW()-TODAY()

Or even

=MOD(NOW(),1)

--
Regards

Roger Govier


"Rick Rothstein (MVP - VB)" wrote in
message ...
NOW gives both the date and the time. in A1:

=NOW()-INT(NOW())


Or even... =NOW()-TODAY()

Rick





  #6   Report Post  
Posted to microsoft.public.excel.newusers,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default now function

On 22 jun, 10:04, "Richard" <nomailplease.com wrote:
I got a cell A1 with a now function =now() which gives the current time.
Cell A2 has a time that is entered, and cell A3 has an if function that
compared if(A1A2,"","Do Something"). However, the if statement is true all
the time even if the time is cell A2 is a later time than A1. I changed the
format in cell A1 from a time format to a general and it turn out to be a
big number. Otherwise, I changed the time format in cell A2 into general
and it is a very small decimal number. How do I get around this, may with a
mod function or something?


This is a bit cumbersome, but it works ok. Press the F9 key at any
time to update the time displayed in C1

A1 =HOUR(NOW())
B1 =MINUTE(NOW())
C1 =TIME(A1;B1;0)

A2 Hour entered by operator (0 - 23)
B2 Minute entered by operator (0 - 59)
C2 =TIME(A2;B2;0)

A3 =IF(C2C1;"Later";"Earlier")

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
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Offset function with nested match function not finding host ss. MKunert Excel Worksheet Functions 1 March 21st 06 10:46 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
how do I write a vlookup function within an iserror function so t. JBLeeds Excel Worksheet Functions 2 March 16th 05 10:30 AM
Nested IF Function, Date Comparing, and NetworkDays Function carl Excel Worksheet Functions 2 December 29th 04 09:57 PM


All times are GMT +1. The time now is 01:26 PM.

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"