简体   繁体   English

在Excel中选择下一个非空单元格

[英]Choose next non-empty cell in Excel

I have a table (Table A) containing 96 rows with data in them. 我有一个表(表A),其中包含96行。 There's a second table (Table B) that references Table A. In Table B there is a calculation that either copies the data from Table A or puts "" because the data is outside of a specified range (eg, IF(A1<500,A1,""). The end result in Table B is several rows without data in them. 还有另一个引用表A的表(表B)。在表B中,有一种计算可以复制表A中的数据,也可以放置“”,因为该数据超出了指定范围(例如IF(A1 <500, A1,“”)。表B中的最终结果是几行,其中没有数据。

I'd like to create a Table C that references Table B, but only copies rows with data in them. 我想创建一个引用表B的表C,但只复制其中包含数据的行。 Eg, if the data in Table B looks like this: 例如,如果表B中的数据如下所示:

465
461
168

46


187
198
48

I'd like Table C to look like this: 我希望表C看起来像这样:

465
461
168
46
187
198
48

Is there way to do this with a formula? 有办法用公式做到这一点吗?

Thanks! 谢谢! Nikki 尼克

Use this: 用这个:

=IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW($A$1:$A$20)/($A$1:$A$20<500),ROW(1:1))),"")

This will skip the blanks as it is copied down. 复制下来时,将跳过空白。

在此处输入图片说明

  1. Select the range containing blank rows you want to remove. 选择包含要删除的空白行的范围。

  2. Click Home > Find & Select > Go To Special. 单击主页>查找并选择>转到特殊。

  3. In the Go To Special dialog box, check the Blanks option. 在转到特殊对话框中,选择空白选项。

  4. And then click OK, all of the entire blank rows are highlighted. 然后单击“确定”,突出显示所有空白行。 Then click Home > Delete > Delete Sheet Rows, the blank rows have been deleted from the selected range. 然后单击主页>删除>删除工作表行,空白行已从选定范围中删除。

You should try with this post: 您应该尝试这篇文章:

https://www.extendoffice.com/documents/excel/2654-excel-dynamic-list-remove-blanks.html https://www.extendoffice.com/documents/excel/2654-excel-dynamic-list-remove-blanks.html

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

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