+ Reply to Thread
Results 1 to 9 of 9

Is there an alternative for =NOW()

  1. #1
    Registered User
    Join Date
    09-11-2014
    Location
    Woubrugge, The Netherlands
    MS-Off Ver
    2007
    Posts
    3

    Is there an alternative for =NOW()

    We have a measuring instrument ( a caliper) which puts the measured dimensions automatically in an Excel file.
    We want to register the time when the the cell in the Excel file is filled with the information from the caliper.

    If we use =IF(R1C1>0;NOW()) for instance, it does not work. If you put new information in an other cell the time changes in the cell with the formula =IF(R1C1>0;NOW()).

    Is there an alternative for NOW()?

    Ido Poelman

  2. #2
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Is there an alternative for =NOW()

    Quote Originally Posted by Ido Poelman View Post
    We have a measuring instrument (a caliper) which puts the measured dimensions automatically in an Excel file. We want to register the time when the the cell in the Excel file is filled with the information from the caliper.

    If we use =IF(R1C1>0;NOW()) for instance, it does not work. If you put new information in an other cell the time changes in the cell with the formula =IF(R1C1>0;NOW()).

    Is there an alternative for NOW()?
    First, do you want to record "the time" [sic] or the date and time? Now() returns the latter. MOD(NOW(),1) returns just time of day.

    In any case, perhaps the following changes will work for you. Change the formula to:

    =IF(R1C1>0;myNow())

    and add the following macro into a "regular" VBA module:

    Function myNow() As Double
    myNow = Now
    End Function

    Change Now to Time if you just want "the time", not date and time.

    Finally, the formula seems odd. It returns FALSE if R1C1<=0 is true. Perhaps it should be:

    =IF(R1C1>0;myNow();"")

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,929

    Re: Is there an alternative for =NOW()

    @joeu2004
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Is there an alternative for =NOW()

    you use a simple macro to fix your value.

    right click on the sheet name at the bottom of excel and select view code.

    Paste this there.

    Please Login or Register  to view this content.

    Each time you change A1 the present date and time will be entered into B1.

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,929

    Re: Is there an alternative for =NOW()

    @Ido Poelman

    If you enter your data in this manner

    CTL + ;

    this will give you the current date hard coded. You can then use that to compare to Now() or Today() in your formula. Using either of those functions to enter data will change your data as you update the worksheet.

  6. #6
    Registered User
    Join Date
    09-11-2014
    Location
    Woubrugge, The Netherlands
    MS-Off Ver
    2007
    Posts
    3

    Re: Is there an alternative for =NOW()

    This very helpful mr. or mrs mehmetcik. It works. What do I have to do when I want this for cell B2 as well?

  7. #7
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Is there an alternative for =NOW()

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    09-11-2014
    Location
    Woubrugge, The Netherlands
    MS-Off Ver
    2007
    Posts
    3

    Re: Is there an alternative for =NOW()

    Dear mr. or mrs mehmetcik. How simple can it be. Thank you verry much for you help. Ido Poelman

  9. #9
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Is there an alternative for =NOW()

    Its is my pleasure.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Alternative to If
    By leviathan86 in forum Excel General
    Replies: 9
    Last Post: 05-20-2014, 07:09 PM
  2. alternative to IF
    By mzarallo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-28-2011, 03:46 PM
  3. IF alternative
    By N-ter in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-25-2010, 06:49 AM
  4. Alternative for INDIRECT
    By Hein in forum Excel General
    Replies: 11
    Last Post: 01-27-2009, 05:42 AM
  5. If alternative
    By Busy Bee in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-29-2006, 07:53 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1