Hello! I have a data set with individuals' weights over time and state of residence. Name Year Weight State Ann 2017 150 MD Ann 2016 160 MD Bob 2017 200 MD Matt 2016 175 TX etc. What I want to do is create a new variable that tells me the percentage of people (not including the current person) that have a higher weight than the current individual in their state for a given year. If it was EXCEL I would do =COUNTIFS(B:B,B2,D: D,D2,C:C,">"&C2)/(COUNTIFS(B:B,B2,😧 D,D2,)-1).
... View more