Apr 24 2023 07:14 AM - edited Apr 25 2023 01:00 AM
I need a formula to change value from A to B after 15 minutes of inserting A.
The ChatGPT suggested me this formula but it did not work
=IF(A1="A",IF(NOW()>=A1+TIME(0,15,0),"B",A1),"")
Apr 25 2023 12:59 AM
Apr 25 2023 01:07 AM
I ask my AI the same question :), here the result…
Excel formulas are recalculated when the workbook is opened or when the data in the workbook changes. This means that a formula cannot automatically update a cell value after a specific amount of time has passed without any changes to the data in the workbook.
One way to achieve a similar result is to use a combination of a formula and a VBA (Visual Basic for Applications) macro. The formula can check if the value in cell A1 is "A" and if the current time is greater than or equal to the time when "A" was entered plus 15 minutes. The VBA macro can be set to run automatically at regular intervals (e.g., every minute) to recalculate the formula and update the cell value if necessary.
Here's an example of how this can be done:
Private Sub Workbook_Open()
Application.OnTime Now + TimeValue("00:01:00"), "UpdateValue"
End Sub
Sub UpdateValue()
Sheet1.Range("B1").Calculate
Application.OnTime Now + TimeValue("00:01:00"), "UpdateValue"
End Sub
Now, when you open the workbook and enter "A" in cell A1, the value in cell B1 will automatically change to "B" after 15 minutes.
Please note that this is just an example and you may need to adjust the cell references and time intervals to fit your specific needs. Also, keep in mind that using macros can pose a security risk and you should only use macros from trusted sources.
Haven't tried it myself, but should work so far and at first glance :).
I hope this helps!
Apr 25 2023 02:10 AM
Apr 25 2023 02:22 AM