SUBTOTAL on filtered data issue

Johnsie007

New Member
Joined
May 11, 2020
Messages
17
Office Version
  1. 2010
Platform
  1. Windows
Hi,

I have a Subtotal array formula that is applied to a range of filtered data.

It works when the data is positive, however, it doesn't seem to work when the data is negative.

{=MAX(SUBTOTAL(104,OFFSET(AH15,ROW(AH15:AH21739)-MIN(ROW(AH15:AH21739)),0,1,1))*(AH15:AH21739<=AH8))}

Essentially, what I am trying to find is the maximum value in the filtered range AH15:AH21739 that is less than the value in cell AH8.

The values in the range are between -0.95 and -0.97. The value in cell AH8 is -0.95.

The formula is returning a value of 0.

It should return the highest possible value that is below -0.95. i.e. -0.96

Is there something obvious that I am missing?

Any help would be greatly appreciated.

Thanks.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
is this any good?
VBA Code:
{=MAX(ABS(SUBTOTAL(104,OFFSET(AH15,ROW(AH15:AH21739)-MIN(ROW(AH15:AH21739)),0,1,1))*(AH15:AH21739<=AH8))}
 
Upvote 0
can multiply by -1 to convert back to negative
 
Upvote 0
The value it needs to return is -0.96. i.e. The highest possible value below -0.95.

+-0.97 is the lowest possible value.
 
Upvote 0
So ignore my formula you need it to look for MIN
 
Upvote 0
Can you please provide an example...when I replace MAX with MIN it still returns 0.97
 
Upvote 0
Without seeing the code some of this is guess work but try -
VBA Code:
{=MIN(SUBTOTAL(104,OFFSET(AH15,ROW(AH15:AH21739)-MIN(ROW(AH15:AH21739)),0,1,1))*(AH15:AH21739<=AH8))}
 
Upvote 0
This still returns the minimum value i.e. -0.97....I need to find the MAX value in the range that is less than the value in AH8. (-0.95).

It should return -0.96.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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