Formula to return a random string from a list of strings?

I want to display arbitrary courses ( MBA, MSc) in OpenOffice Calc. I did my best:

=RANDBETWEEN('MBA', 'MSc')  

as well as

=RAND('MBA', 'MSc')'  

but they do not work as we would like.

+4
source share
2 answers

In OpenOffice Calc, the function returns a value from 0 to 1 - so you will have to combine different formulas to get a random selection of two text values. The following steps must be completed: RAND

  • round the result of rand to an integer;
  • based on this integer, select from the list.

Try the following formula:

=CHOOSE(ROUND(RAND()+1);"MBA";"MSc")

or split into different lines:

=CHOOSE(
    ROUND(
        RAND()+1
    );
    "MBA";
    "MSc"
)

; :.

:

+4

, , . .

OpenOffice RAND ...

RAND()*(b-a) + a

returns a random real number between a and b. 

CHOOSE 1 6, 6 , RAND 1 6, a = 1 b = 6.

,

=CHOOSE(ROUND(5*RAND()+1);"Business";"Science";"Art";"History";"Math";"Law")

, , . 1 10 , , , 2 10 .

=CHOOSE(ROUNDUP(6*RAND()+0.00001);"Business";"Science";"Art";"History";"Math";"Law")

, .

+1

All Articles