+ Reply to Thread
Results 1 to 4 of 4

IF formula for time

  1. #1
    Registered User
    Join Date
    04-30-2006
    Posts
    62

    IF formula for time

    I have cells A1 & B1. What I want is when I put "1" into A1, for B1 to show the current time. Can I use an IF formula? =IF(A1 = 1,"????","")

    Thanks,

  2. #2
    Niek Otten
    Guest

    Re: IF formula for time

    =IF(A1=1,NOW(),"")

    Format as Time

    --
    Kind regards,

    Niek Otten

    "fastballfreddy" <[email protected]> wrote in message
    news:[email protected]...
    |
    | I have cells A1 & B1. What I want is when I put "1" into A1, for B1 to
    | show the current time. Can I use an IF formula? =IF(A1 =
    | 1,"????","")
    |
    | Thanks,
    |
    |
    | --
    | fastballfreddy
    | ------------------------------------------------------------------------
    | fastballfreddy's Profile: http://www.excelforum.com/member.php...o&userid=33986
    | View this thread: http://www.excelforum.com/showthread...hreadid=539501
    |



  3. #3
    Registered User
    Join Date
    04-30-2006
    Posts
    62
    Thanks for the reply Niek. I tried that before and it's not working for what I want it to do.

    What I am trying to do is I have a list of 100 #s in column A. Once I get done working the first # (in A1). I want to put "1" in B1. Once "1" is entered I want C1 to show the current time. I'll repeat the steps, finish A2, put "1" in B2 and the current time will show in C3.

    With the previous formula: =IF(A1=1,NOW(),"")

    C1, C2, C3 and so on would be the same time, updating everytime you input a "1" if the time change. Is there something that can be changed w/ the current formula, or is there another formula out there?

    Thanks,

  4. #4
    Registered User
    Join Date
    05-05-2006
    Posts
    8
    I think a macro is needed here:-

    Right click on the sheet you are using
    select View Code
    in the first dropdown box towards the top of the page select Worksheet
    in the one to the right select selection change
    then ensure the code window below displays the following code(copy and paste the bits you need)

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If ActiveCell.Value = 1 And ActiveCell.Column = 2 And IsEmpty(ActiveCell.Offset(0, 1)) Then
    ActiveCell.Offset(0, 1) = Now()
    End If
    End Sub

    somethinglikeant

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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