Days difference between two adjacent duplicate PIN numbers

Hi have multiple visit of same PIN number and i want to calculate number of days between the visits and add it to next coulmn called “days difference”.

Is it possible that a formula checks for Duplicate PIN number in next row and if found can output “days difference” between visit?

I have almost no knowledge about formulas. Any help will be appreciated.

Here is my screenshot of columns

To be able to help you, I need further information.

What is the specific use case you want to show here, and which SeaTable version do you use?