简体   繁体   中英

Excel range for data based on cell value

I am trying to create Excel which will extend or decrease range based on cell value.

I have 3 columns (cell for data, formula1, formula2)

I want to type number in to cell under "Number of units" and than generate for example 1000 rows of these 3 columns (cell for data, formula1, formula2)

Formula 1 - =IF(K5=0;"";K5) is on every row same (I have defined list)

Formula 2 - =IF(G5&H5="";"";(G5&","&H5)) needs to increment by 1 on every next row

Can you help me, how to achieve this function?

Here is a screenshot for better illustration:

Screen here

Thanks for every advice.

Presuming you want to look up the n values from a table matching your type, where n is the number of records to be shown (see Picture), it can be done with the following Array formula

=IFERROR(INDEX($B$4:$B$500,SMALL(IF($D$1=$A$4:$A$500,ROW($A$4:$A$500)-ROW($A$4)+1),IF(ROW(1:1)<=$G$1,ROW(1:1),""))),"")

Please Keep in mind to enter the formula pressing CTRL + ALT + ENTER

在此处输入图片说明

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