Subtract The Top Visible 2nd and 3rd row from a filtered list?

gvillepa

New Member
Joined
Oct 18, 2017
Messages
36
Hi all,

I'm trying to work a formula that always subtracts the 3rd visible row and cell data from the 2nd visible row and cell data to return the result from a filtered list.

Every time i filter it returns 3 rows of data (a header, and 2018 data and 2017 data). But when you filter different data paramteres for 2017 and 2018, it could be row 5 and 73 showing or 99 and 276, or whatever, but they are always going to be in the 2nd and 3rd row. I am thinking mod function, but that's as far as my brain takes me. Resorting to folks smarter than myself.

Thanks!
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hi

With the header cell A1 and the values in A2:A100, try:

=SUM(N(OFFSET($A$2,SMALL(IF(SUBTOTAL(2,OFFSET($A$2,ROW($A$2:$A$100)-ROW($A$2),))=1,ROW($A$2:$A$100)-ROW($A$2)),{1,2}),))*{1,-1})
This is an array formula, you have to confirm it with CTRL-SHIFT-ENTER.
 
Upvote 0
Much obliged pgc01. It works and works well. Now i just have to follow the formula to understand how you constructed it!! I could not have thought of that myself. Thanks again.
 
Upvote 0

Forum statistics

Threads
1,223,714
Messages
6,174,052
Members
452,542
Latest member
Bricklin

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