How to generate series of horizontal numbers?

1. How to generate series of horizontal numbers?

Well it's a little bit hard to explain but it's pretty simple;

One of my cells on Excell is going to take a random number.
I need to generate series of separated "1"s horizontally with the exact amount of that random number.
For example if the random number is "4" I need it to generate on four cells "1 1 1 1".
Or if it's "2" generate on two cells "1 1". If it's 3 then "1 1 1" and so on. That random number is gonna change many times.

-I don't know if it helps but I need separated "1"s because I need to multiply each one by other different random numbers.
-(I know how to do this, my question is just the one above, it's just informative) My random number obviously just gonna take integer numbers and the limit is nine, actually it can take any value from 1 to 9 except 3.

I hope it's possible to do, and to have been clear with the question (English is not my first language).

Thank you so much :).

2. Re: How to generate series of horizontal numbers?

a1= random number b1 across to j1 =if(columns(\$a\$1:a1)>\$a\$1,"",1)
if you want nothing for 3
=IF(OR(COLUMNS(\$A\$1:A1)>\$A\$1,\$A\$1=3),"",1)

3. Re: How to generate series of horizontal numbers?

Originally Posted by martindwilson
a1= random number b1 across to j1 =if(columns(\$a\$1:a1)>\$a\$1,"",1)
if you want nothing for 3
=IF(OR(COLUMNS(\$A\$1:A1)>\$A\$1,\$A\$1=3),"",1)
Thank you so much it worked perfectly! It doesn't look simple at all, I couldn't have come up with that by myself, thanks again :D!

There are currently 1 users browsing this thread. (0 members and 1 guests)