if statement true=now false retains last true

173

Joined
Aug 31, 2008
Messages
2
Reaction score
0
What I have is a worksheet that automatically updates info into it every minute. I have a cell that evaluates if the inported data is true or false. I want another cell to enter the current time when the true statement is activated. This cell should retain the previous true statements value until a new true statment is made. For example:

At the listed times, A1 & B1 should read as follows:
11:02 A1=FALSE B1=11:01
11:01 A1=TRUE B1=11:01
11:00 A1=TRUE B1=11:00
10:59 A1=FALSE B1=10:56
10:58 A1=FALSE B1=10:56
10:57 A1=FALSE B1=10:56
10:56 A1=TRUE B1=10:56

Can an If statement be used?
Something like: =IF(A1=TRUE,now(),)
Any help out there?
Thanks
 
Joined
Aug 27, 2008
Messages
44
Reaction score
0
The only way that I can think of requires VB, you could put this in the ThisWorkbook code sheet
Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Excel.Range)
    If CBool(CStr(ThisWorkbook.Sheets("sheet1").Range("A1"))) Then
        ThisWorkbook.Names.Add Name:="LastTrue", RefersToR1C1:=Now()
    End If
End Sub
and in B1, put the formula
=LastTrue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

SUMIF "value if false" not working 2
Formula anomaly 7
Work Hours 1
IF calculation of Time 2
True or false 2
IF STATEMENT PROBLEM 4
Urgent 2
Display row number of the last value in a column 4

Top