Formula to prefilter data and choose a random row from that

LibreOffice Calc 7.6.3.2
Windows 11

I have a simple LibreOffice Calc file with 2 sheets:

  • A sheet called Randomizer which returns a new random row from the Problems sheet based on some values.
  • A sheet called Problems which basically contains the data of the document.

In the Randomizer sheet, I was able to return a random problem from within the Problems sheets.
However, I want to also be able to return a random problem based on certain column values.
How can I achieve that?

I would love to have everything done via only formulas.
Like I just did with the general randomizer.
I do not mind if the resulting formula is either slow or inefficient, as long as it works.
The list of problems is only going to have almost 500 rows of data.

Please, take a look at the workbook that I uploaded.
Thank you.
Problems.ods (24.5 KB)

ask117436.odb (25.6 KB)

1 Like

See attached:
LET_solve_the_problem.ods (26.6 KB)
with a couple of:

  • ⇒ Named Ranges …
  • ⇒ Data ⇒ Validity…⇒ Cellrange…

Had to update LibreOffice to 24.8 but it works!

https://help.libreoffice.org/latest/en-US/text/scalc/01/func_let.html

This function is available since LibreOffice 24.8.
This function is not part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is COM.MICROSOFT.LET

Thank you!