How to Dynamically reference Pivot Index / index Value

I am using “=IF(PIVOTOFFSET(D1, 0, -1) < 0, PIVOTINDEX(), NULL)” this formula to reference the corresponding pivot index value , but everytime index 1 is getting referenced.
Is there anyway we can directly reference pivot index value or its index?

Hi! This formula looks correct and should work as expected, I’m wondering if there are multiple pivots being used or something else impacting the formula in your workbook?

An example of what I’m seeing when replicating it. Are you looking to get the pivot value instead of the index?