Formula for displaying first and last filtered values?

Big Lar

Well-known Member
Joined
May 19, 2002
Messages
557
Sheet1 Row 1 = Column headers
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
After Sheet1 AutoFilter <o:p></o:p>
<o:p></o:p>
Sheet2 A1= First filtered value from Sheet1 Column A<o:p></o:p>
Sheet2 B1= Last filtered value from Sheet1 Column A<o:p></o:p>

Thanks for your participation.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Try the following...

First:

=INDEX(A2:A100,MATCH(1,SUBTOTAL(3,OFFSET(A2:A100,ROW(A2:A100)-ROW(A2),0,1)),0))

...confirmed with CONTROL+SHIFT+ENTER.

Last:

=LOOKUP(2,1/(SUBTOTAL(3,OFFSET(A2:A100,ROW(A2:A100)-ROW(A2),0,1))),A2:A100)

Edit: Adjust the range and add the appropriate sheet reference...
 
Upvote 0
Domenic...you following me? LOL

The data is on Sheet1.
I'm trying to display first and last filtered values on Sheet2. Isn't there a missing reference in those formula?

Plus, my Sheet1 has potential for several thousand rows of data.

Thanks for you help.
 
Upvote 0
Domenic...you following me? LOL

:-)

The data is on Sheet1.
I'm trying to display first and last filtered values on Sheet2. Isn't there a missing reference in those formula?

I guess you missed my edit. :-)

Sheet2!A1:

=INDEX(Sheet1!A2:A100,MATCH(1,SUBTOTAL(3,OFFSET(Sheet1!A2:A100,ROW(Sheet1!A2:A100)-ROW(Sheet1!A2),0,1)),0))

...confirmed with CONTROL+SHIFT+ENTER.

Sheet2!B1:

=LOOKUP(2,1/(SUBTOTAL(3,OFFSET(Sheet1!A2:A100,ROW(Sheet1!A2:A100)-ROW(Sheet1!A2),0,1))),Sheet1!A2:A100)

Plus, my Sheet1 has potential for several thousand rows of data.

You'll need to adjust the range, accordingly. If the range will keep increasing in size, convert your data into either a list (Excel 2003, Data > List > Create List) or table (Excel 2007 or later, Insert > Tables > Table). Then, your references will automatically adjust as data is added/removed.

Thanks for you help.

You're very welcome!
 
Upvote 0
The LOOKUP works perfectly, but...

=INDEX(Sheet1!A2:A100,MATCH(1,SUBTOTAL(3,OFFSET(Sheet1!A2:A100,ROW(Sheet1!A2:A100)-ROW(Sheet1!A2),0,1)),0))
results in #N/A...I can't figure out why.

(Too many 0,1))-,0) for me maybe?)

You=Genius
Me=NotSoMuch
 
Upvote 0
Did you confirm the formula with CONTROL+SHIFT+ENTER, not just ENTER?
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,875
Members
452,949
Latest member
Dupuhini

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