找到首先发生的数字的行索引 [英] find a row index of a number that occurred first

查看:73
本文介绍了找到首先发生的数字的行索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 A 列,其值为随机顺序,如

I have A column that has values in random order like

       A column
           2
           3
           4
           2
           5
           6
           4
           3
           4

我想要首先发生的特定号码的行索引。说如果我说数字是4,返回的值应该是3

I want the row index of a particular number that occurred first. say if i say the number is 4 the value returned should be 3

我也想要一个特定的数字的行索引last.Say如果我说的数字是3然后返回的值必须为8

I also want the row index of a particular number that occured last.say if i say the number is 3 then the value returned must be 8

我在想 Vlookup find 函数必须执行任务,但无法将它们放在order.please帮助我这些

I was thinking Vlookup or find function must do the task but unable to put them in order.please help me with these

推荐答案

我的示例正在寻找号码 3 ,但很容易适应。

My examples are looking for the number 3 but it is easy to adapt.

要找到第一次发生,您可以使用:

To find the first occurence, you can use:

=MATCH(3,A:A,0)

要找到最后一个,您可以使用数组公式(使用 Ctrl + Shift + 输入

To find the last one, you can use an array formula (validate with Ctrl+Shift+Enter)

{=MAX(IF(A1:A10=3,ROW(A1:A10),0))}

请注意,您也可以使用第一个数组公式, code> MIN 但是它值得相当复杂。

Note that you could also have used an array formula for the first one with a MIN but it would be quite complicated for what it's worth.

这篇关于找到首先发生的数字的行索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆