Hello,

I am looking to write an percentile function that ignores values in the range that are below a certain value and above another certain value (or that only includes values that fall between x and y)

Looking around on the web, I saw how to write a percentile function that excludes 0 values in the range. Expanding upon that knowledge I was able to figure out how to ignore values either greater than a certain value or less than a certain value, but not both.

For example, when I use {=PERCENTILE(IF(I$4:I$1255>45000,I$4:I$1255),.02)} it give me the 2nd percentile for all the values in the range, and excludes values less than 45000 and it works

This is what I came up with, but is not working: {=PERCENTILE(IF(AND(I$4:I$1255>45000,I$4:I$1255<500000),I$4:I$1255),.02)}

I want {=PERCENTILE(IF(AND(I$4:I$1255>45000,I$4:I$1255<500000),I$4:I$1255),.02)} to look in I4 through I1255, and then give me the 2nd percentile of using the values that fall between 45000 and 500,000 (or excluding the values that fall outside of 45,000 and 500,000)

This formula is yielding 0s for all the percentiles.

I also tried the formula {=PERCENTILE(AND(IF(I$4:I$1255<I$1274,I$4:I$1255),IF(I$4:I$1255>I$1273,I$4:I$1255)),0.02)} but it has the same issue.

Is it possible to do what I am looking to do?

Best regards,
Kia