Calculating days between similar or matching rows/events?Hi everyone, I have a list of events and their dates. I want to calculate the number of days since a matching event happened.
For example, I have a list of patients visiting a doctor. I have the first two columns, Name and Date of Visit, but I would like to know how to calculate the third column, Days Since Last Visit. This would return only the number of days since Dave's most recent visit. Any guidance, especially in formula creation, would be appreciated.
| Name | Date of Visit | Days Since Last Visit |
| John | 6/1/2018 | . |
| Dave | 6/14/2018 | . |
| Mike | 6/17/2018 | . |
| Mike | 6/21/2018 | 4 |
| Dave | 7/1/2018 | 16 |
| John | 7/3/2018 | 32 |
Re: Calculating days between similar or matching rows/events?This is perfect, exactly what I needed. Thanks!
Re: Calculating days between similar or matching rows/events?Bearcat, there are likely multiple methods to do this, but here is my recommendation. Create a column named Date of Last Visit and then find the difference. To get the date of the last visit, I attached a script to the data table.
So add new records, run the table script and the table is updated. By keeping the Date of Last Visit, it is easier to verify results.
Note to get days find the difference in the dates and divide by 24*60*60, the number of seconds in a day.
I hope this helps.