Description: Cell A1: =REPT("a";B1) Cell B1: =RANDBETWEEN.NF(1;10) Safe and open the file and you see, the A1 the error in A1 Steps to Reproduce: 1. Cell A1: =REPT("a";B1) 2. Cell B1: =RANDBETWEEN.NF(1;10) 3. Safe and open the file and you see, the A1 contains wrong number of 'a'. Actual Results: Example Cell B1 contains 8 Cell A1 contains "aa" Expected Results: Cell B1 contains 8 Cell A1 contains "aaaaaaaa" Reproducible: Always User Profile Reset: No Additional Info: While RANDBETWEEN.NF is recalculated by opening the calc-file, the cell with rept won't be updated.
Created attachment 169253 [details] Calc-file, which shows in cell A1 the rept -problem Please open the file and you see the problem immediatly in cell A1 versus A2.
Assignee field is for those who work on a bug fix, is it your intention or just a mistake? Also don't confirm your own bug. On pc Debian x86-64 with master sources updated today, I got the same behavior as reported. Now I'm not an expert but not sure if it should really change each time you open Calc. Let's wait feedback from other QA people or Calc experts.
In A2 NOW() function that it's volatile forces the calculation. But not clear to me why REPT() is not calculated and RANDBETWEEN.NV() is. And not matter in which cell REPT() is put. Deleting the cell with NOW() ind, doesn't solve the issue, even more in this case [F9] only works if you are in the cell with REP(). Looks to me like some kind of bug.
It is working with Data - Calculate - Recalculate Hard, OR Shift+Ctrl+F9, but I don't say that is not a bug. Maybe it should be automatically recalculated. Version: 7.0.4.2 Build ID: dcf040e67528d9187c66b2379df5ea4407429775 CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3 Locale: ro-RO (ro_RO.UTF-8); UI: en-US Calc: threaded
NOW() is a volatile function; REPT() is not. RANDBETWEEN.NV() is not a volatile function either, but it is recalculated under certain circumstances such as when opening the file (see help content). You could modify menu Tools > Options > LibreOffice Calc > Formula > Recalculation on File Load, or manually use Data > Calculate > Recalculate Hard ([CTRL]+[SHIFT]+[F9]), but these might not be enough when sharing the file. Or instead of =REPT("a";B1) ...you add some volatile function. For instance (just as a generic example): =REPT("a";B1)&T(NOW()) If you have to use this method on multiple cells, you could have: C1: =T(NOW()) A1: =REPT("a";B1)&$C$1 ...and re-use "&$C$1" (or "+$C$1" on numeric functions/cells) on each relevant cell. These methods would force the recalculation on that/those specific cell(s). Each alternative has its own pros and cons. Another possibility would be to use the RANDBETWEEN.NV() function as the second argument of REPT(), but that would be only useful when there are no other cells that would need to depend on the same resulting value of the same RANDBETWEEN.NV() function. When multiple cells must depend on the _same_ result of the RANDBETWEEN.NV() function, this alternative would not be a valid approach.
OTOH, RANDBETWEEN() _is_ a volatile function, so you might just use that instead of RANDBETWEEN.NV().
There is one additional POV for this report; which is the possible need/desire to recalculate RANDBETWEEN.NV() only once when the file is loaded (or for whichever event the function is normally recalculated), and _then_ recalculate any dependent cells. I guess that such approach would make this an enhancement request for some additional option or some kind of new variant on RANDBETWEEN.NVxx().