跳到主要内容

如何在Excel中查找第n个非空白单元格?

如何在Excel的列或行中查找并返回第n个非空白单元格值? 本文,我将讨论一些有用的公式供您解决此任务。

从具有公式的列中查找并返回第n个非空白单元格值

从具有公式的行中查找并返回第n个非空白单元格值


箭头蓝色右气泡 从具有公式的列中查找并返回第n个非空白单元格值

例如,我有一列数据,如下图所示,现在,我将从该列表中获得第三个非空白单元格值。

doc find nth非空白1

请输入以下公式: =INDEX($A$1:$A$25,SMALL(ROW($A$1:$A$25)+(100*($A$1:$A$25="")), 3))&"" 放入要输出结果的空白单元格(例如D2),然后按 Ctrl + Shift + Enter 键在一起以获得正确的结果,请参见屏幕截图:

doc find nth非空白2

备注:在上式中 A1:A25 是您要使用的数据列表,以及数字 3 表示要返回的第三个非空白单元格值,如果要获取第二个非空白单元格,则只需要根据需要将数字3更改为2。


箭头蓝色右气泡 从具有公式的行中查找并返回第n个非空白单元格值

如果要连续查找并返回第n个非空白单元格的值,请按照以下公式进行操作:

输入以下公式: =INDEX($A$1:$M$1,SMALL(IF($A$1:$M$1<>"",COLUMN($A$1:$M$1)-COLUMN($A$1)+1),4)) 放入要查找结果的空白单元格,然后按 Ctrl + Shift + Enter 键一起获得结果,请参见屏幕截图:

doc find nth非空白3

请注意: 在上式中 A1:M1 是您要使用的行值,以及数字 4 是要返回的第四个非空白单元格值,如果要获取第二个非空白单元格,则只需根据需要将数字4更改为2。

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
Comments (10)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
CIAO STO CERCANDO DI APPLICARE LA TUA FORMULA MA NON MI FUNZIONA, DOVE STO SBAGLIANDO?
=INDICE($K$37:$K$88;MIN(RIGHE($K$37:$K$88)+RIGHE(100*($K$37:$K$88=""));6))&""
DEVO VISUALIZZARE L'ENNESIMA RIGA DIVERSA DA VUOTO

GRAzie
This comment was minimized by the moderator on the site
=INDICE($K$37:$K$88;MIN(RIGHE($K$37:$K$88)+(100*($K$37:$K$88=""));6))&""
This comment was minimized by the moderator on the site
I'm running this formula on a ~400 row sheet with around 20 blanks mixed throughout the data, and it's working perfectly EXCEPT when I fill the series down, it sometimes duplicates a row for some reason. For example, it seems to think a value is somehow simultaneously the 331st non-blank and the 332nd.

Things I've noticed:
-Duplications always happen in pairs (ex. 331 and 332 are duplicates, 333 and 334 will also be), then it goes back to normal for a while.
-Raw data also has blanks in pairs, but not corresponding to the duplicates
-No duplications occur in the first 94 rows, but they happen every 33-35 rows after that
-Does not appear to be linked to the value in the cell being duplicated
-I have entered as an array and as a standard formula, no difference in function

For reference, here's my actual formula:

=INDEX('PO Raw Data'!CR:CR,SMALL(ROW('PO Raw Data'!CR:CR)+(100*('PO Raw Data'!CR:CR="")),$W2)&"")

Note $W2 refers to a helper column and counts up as the data set is filled down, but only because I couldn't get it to count up when I just used a number instead of cell reference.
When I've replaced that cell reference (ex. $W2) with the appropriate number, same result.


Any thoughts on what I can do to fix that?
This comment was minimized by the moderator on the site
very helpful,
although when I return the nth non blank cell in a column set to DATE, the returned value appears as number(general number).formatting the cell into DATE also doesn't change the result. could you please give me a hand!
thanks a lot
This comment was minimized by the moderator on the site
Hello, Shirazi,
Sorry, maybe there is no direct formula for you to get the date format.

If someone else has the solution, please comment here.
This comment was minimized by the moderator on the site
Hi everyone!


Could you also help me return the row number of the second, third non-blank cell?


Please help me.
This comment was minimized by the moderator on the site
Hello, John,
the following formula can help you to get all the row numbers of the non-blank cells, please try it, thank you!
=IFERROR(ROW(INDEX($A$1:$A$12,SMALL(INDEX(NOT(ISBLANK($A$1:$A$12))*ROW($A$1:$A$12),0),COUNTBLANK($A$1:$A$12)+ROW(A1)))),"")
This comment was minimized by the moderator on the site
Hey everyone,

I have a table with numerous columns and rows. The rows have range names, and a description/location at the beginning of the row range with its own range, example "Building No.s". There are multiple Row Ranges/ Buildings. There are headers at the top of each columns for specific "Building Assembly Types". The table content is numeric quantities for each type "Building Assembly Type" for each specific "Building" description/location. There could be as many as (100) "Building Assembly Types" column headers but I will limit the assemblies to (10) per row range, so there will be numerous blank cells in each "Building No." range.

I have other summary tables set up for each "Building" that I want to pull the non-blank cells quantities to, along with the corresponding header "Assembly Type" for each "Building" with a (10) max "Assemblies" per page.

I can identify the non-blank cell quantities by use of the array formula above for rows. The problem I am having is identifying the header that corresponds to it.

Ultimately if I can identify the "Assembly" header, I can always index the "Quantities" once I have the header "Assembly" identified for each "Building". Then I would be able do a lookup for all the parts associated with each "Assembly" type for that "Building" from my Assembly parts database and multiply it times the "Quantity" of each assembly type.

Hopefully this makes since and someone can help.
This comment was minimized by the moderator on the site
Hello, I am looking for the third blank row in a column and I copied your formula and just changed the range from $A$1:$A:$25 to my range $D$306:$D$354. But when I change the range I get #REF! as my answer. I already converted to an array, control-shift-enter. Now the cell range I am referencing has formulas in them, so could that be why I am getting #REF. Your formula: =INDEX($A$1:$A$25,SMALL(ROW($A$1:$A$25)+(100*($A$1:$A$25="")), 3))&"" My formula: =INDEX($D$306:$D$354,SMALL(ROW($D$306:$D$354)+(1*($D$306:$D$354="")), 2))&"" Thanks, Noel
This comment was minimized by the moderator on the site
you have put the 1 instead of 100 therefore answered was wrong. please use below formula

INDEX($D$306:$D$354,SMALL(ROW($D$306:$D$354)+(100*($D$306:$D$354="")), 3))&"" than ctrl + shift+enter
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations