Return first visible row number that contains specific value

Worker8ee

New Member
Joined
Aug 8, 2018
Messages
28
I cannot figure out if there is a formula that would enable me to return the row number of the first visible row that contains a specific value. Let's say I have varying words in range A2:A100, I want to return the first visible row that contains the word "Apple", keep in mind that other rows have been hidden using a filter and that some of those might have the word "Apple" as well. Any ideas are appreciated.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Try this array formula:

varios 07jul2020.xlsm
AB
1A9
5Orange
9Apple
13Banana
17Apple
18
19
20
Hoja11
Cell Formulas
RangeFormula
B1B1=MIN(IF(SUBTOTAL(3,OFFSET(A2,ROW(A2:A20)-ROW(A2),,1))>0,IF(A2:A20="Apple",ROW(A2:A20))))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Thanks Dante that did the trick! I am extremely grateful for you taking the time to help me with this. In case other users use this solution I do want to point out that I changed one part of your formula to be 'subtotal(103' instead of 'subtotal(3' so that it would ignore the hidden rows. Thank you again!


Try this array formula:

varios 07jul2020.xlsm
AB
1A9
5Orange
9Apple
13Banana
17Apple
18
19
20
Hoja11
Cell Formulas
RangeFormula
B1B1=MIN(IF(SUBTOTAL(3,OFFSET(A2,ROW(A2:A20)-ROW(A2),,1))>0,IF(A2:A20="Apple",ROW(A2:A20))))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,780
Messages
6,121,527
Members
449,037
Latest member
tmmotairi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top