简体   繁体   English

基于单元格值的Excel数据范围

[英]Excel range for data based on cell value

I am trying to create Excel which will extend or decrease range based on cell value. 我正在尝试创建Excel,它将根据单元格值扩大或缩小范围。

I have 3 columns (cell for data, formula1, formula2) 我有3列(数据单元格,公式1,公式2)

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) 我想在“单位数”下的单元格中键入数字,然后生成例如这3列的1000行(数据单元格,公式1,公式2)

Formula 1 - =IF(K5=0;"";K5) is on every row same (I have defined list) 公式1- =IF(K5=0;"";K5)在每一行都相同(我已定义列表)

Formula 2 - =IF(G5&H5="";"";(G5&","&H5)) needs to increment by 1 on every next row 公式2- =IF(G5&H5="";"";(G5&","&H5))需要在下一行增加1

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 假设您要从与您的类型匹配的表中查找n个值,其中n是要显示的记录数(请参见图片),可以使用以下Array公式完成此操作

=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 请记住按CTRL + ALT + ENTER输入公式

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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