Static now() function for a log

I’m creating a log that needs a time-stamp on each line as the line is created. I tried the now() function which puts a time-stamp on the line created, however, the time-stamps of all other lines are updated to the current now() time of the new line when a new line is created.

Need a “static now()” function that updates only on creation.

If you want your time-stamp in col A - format col A as DD-MM-YY HH:MM (or what is suitable in your language)
Put this formula in A1: =IF(B1="";"";IF(A1="";NOW();A1)) and copy down.
Under Menu:Tools - Options - LibreOffice Calc - Calculate mark Iterations (this is only saved in current document)
Each time you add something in col B the time-stamp will show up in col A

Jens

Jens answer gives an error notice, not the NOW() result. Getting the NOW() result in column A as a result of a condition in column B is not difficult. A simple IF() functions does nicely. The problem is, the NOW() result is not static. That is, for example, if a row in Column A should receive the result of NOW() as a condition of the presence of a row entry in column B, the result is indeed the value of NOW(). Good enough so far. HOWEVER, subsequent rows when they are entered change the value of ALL the previous entries in column A to the value of the newest NOW() result. A new line entry causes ALL NOW() results to change to the same value. That means that it looks like the whole log was entered at the same time-- the time given by the last row. Is there a way to fool NOW() into reporting only one time?

Hi @HamMan, there are shorcuts for it [Ctrl]+[;] or [Ctrl]+[Shift]+[;], but I have changed it because with a Spanish keyboard [;] is a shift character and the shortcut doesn’t works.
You can change it in: Menu/Tools/Customize - Keyboard.

Thank you for that answer. I was unaware of that CTR;-SHIFT-; shortcut.

I should have been a bit more specific as to the function needed. It would be time-saving in a fast moving environment to have a time stamp in a cell upon certain text being entered into an adjacent cell. Thus, as the log becomes filled in with text, each line is stamped with the current time automatically with no other interaction. The now() function would be perfect if there were an option to have it only update upon first line creation. As it is, using an if() function, I can get the now() function to work; however, when subsequent lines are entered ALL of the previous time-stamps are updated to reflect the time of the last created line. It won’t work.

Is there a way to use the CTRL-SHIFT-; shortcut in an expression such as =if(b2>0,CTRL-SHIFT-;,"") ?