简体   繁体   English

Excel 在列中查找第 N 个非空白值

[英]Excel Find the Nth Non Blank Value in Column

I want to look at a column and return the Nth Non-blank value.我想查看一列并返回第 N 个非空白值。 For the most part, I will only want to return the first 15 non-blank values.在大多数情况下,我只想返回前 15 个非空白值。

The below question has an answer that almost works for me, but I can't figure out how to modify the formula:下面的问题有一个几乎对我有用的答案,但我不知道如何修改公式:

How to get nth non-blank column in Excel 如何在 Excel 中获取第 n 个非空白列

The formula finds the 3rd to last non blank value in a column:该公式在列中查找倒数第三个非空白值:

 =INDEX(A1:A202,AGGREGATE(14,6,ROW(A1:A202)/(A1:A202<>""),3))

I thought the modification would be easy to just find the 3rd value, but I can't seem to figure it out.我认为修改很容易找到第三个值,但我似乎无法弄清楚。 Can someone please help me modify this and help explain to me what this formula is doing?有人可以帮我修改这个并帮助向我解释这个公式在做什么吗?

Thanks谢谢

If you have Excel 365 and if your data is in column A and N is in cell B1 , try the following:如果您有Excel 365并且您的数据在A列中并且N在单元格B1中,请尝试以下操作:

=INDEX(FILTER(A:A,A:A<>""),B1)

在此处输入图像描述

NOTE:笔记:

The INDEX() function can accept a dynamic drop down formula just like a column of cells. INDEX() function 可以像一列单元格一样接受动态下拉公式。

Please try this formula.请试试这个公式。

=INDEX(Data,SMALL(IF(Data<>"",ROW(Data)-MIN(ROW(Data))+1),C1))

Data is the column range from which you want to return the nth non-blank value. Data是您要从中返回第 n 个非空白值的列范围。 You can replace the name with a hard-coded address.您可以将名称替换为硬编码地址。

C1 = holds the value for n. C1 = 保存 n 的值。

The formula is adapted from ExcelJet where it's advertised as an array formula (confirm with Ctl + Sift + Enter) but on my Excel 365 it works as a normal formula.该公式改编自ExcelJet ,它被宣传为数组公式(使用 Ctl + Sift + Enter 确认),但在我的 Excel 365 上,它作为普通公式工作。

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

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