VBA: scenarios when using `Application.WorksheetFunction` to calculate percentiles in Excel 2016
I'm a bit lost with After trying multiple solutions online, I still can't figure this out. I'm working with an scenario when trying to calculate the 25th percentile of a range using VBA in Excel 2016. I want to utilize the `Application.WorksheetFunction.Percentile` method, but I receive the runtime behavior '1004: Application-defined or object-defined behavior' when executing my code. Here's what I've tried so far: ```vba Sub CalculatePercentile() Dim dataRange As Range Dim percentileValue As Double Set dataRange = ThisWorkbook.Sheets("Sheet1").Range("A1:A100") percentileValue = Application.WorksheetFunction.Percentile(dataRange, 0.25) Debug.Print "25th Percentile: " & percentileValue End Sub ``` The data in column A is numeric, and I have verified that the range contains values. I also checked for blank cells, but I don't think that should be an scenario since `Application.WorksheetFunction.Percentile` can handle them. When I step through the code, the behavior occurs specifically on the line where I call the `Percentile` function. I've tried using `Application.WorksheetFunction.PERCENTILE` and even `Application.PERCENTILE`, but the results are the same. Additionally, I have ensured that my Excel is updated to the latest version. Does anyone have insights or suggestions on how I can fix this or work around the scenario? Thanks in advance! My development environment is Ubuntu. I'd really appreciate any guidance on this. The stack includes Vba and several other technologies. Could someone point me to the right documentation? The stack includes Vba and several other technologies. I'd be grateful for any help. I'm open to any suggestions.