PDA

View Full Version : Help VBA code for calculating time difference



pathdo
10-16-2012, 09:15 AM
I have multiple patients with data collected at different points and each patient is seperated by a space.

I need to write a code to calculate the time between the first data point and the other data points. The problem is each patient has a different number of data points that were collected so I need the excel sheet to notice the blank space then restart calculating the time difference.

See example attached.

Any help... I have 37000 data results and don't want to have to do this by hand. :)

Kenneth Hobs
10-16-2012, 01:17 PM
Welcome to the forum!

In M2 and copy down:
=IF(AND(H1<>"",A2<>""),H2-H1+M1,"")