简体   繁体   中英

Insert rows based on cell value using formula

How to insert rows with random data based on a cell value. Example: If A1 cell is having=4, it should insert 4 rows in Name, Age(random value) columns

I want to do it using formulas not by macro

Lets say D1 is the header name and E1 is the header age

Enter on D2 For name:

=IF($A$1>=ROW(D1),CHAR(RANDBETWEEN(65,90)),"")

and on E2 for age:

=IF($A$1>=ROW(D1),RANDBETWEEN(1,120),"")

You can drag both formulas to the max amount of numbers you desire.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM