Rounding Down time elapsed to nearest 6 months

panesai1

New Member
Joined
Dec 15, 2015
Messages
18
Hi all,
The context is this: Patients are invited for a long-term (8 years) Research study on a new treatment.
Each patients are followed-up with Hospital clinic visits every 6 months (for 8 years) to track their progress.
Each patient begins their participation in the study at different times.
e.g. The first patient started his treatment 20-Jun-2012 and the last patient started his treatment 31-Dec-2015.
Let's say there are 100 patients (n=100) in total enrolled in this study.

I have an Excel sheet similar to the below. I have only shown the columns up to 36months, just so you get the idea. It actually goes up to 8 years on my XL sheet.

In Row 4, I already have a formula which shows me when each patients 6 month visit will be, 12 month visit will be, based on my input of their treatment date in Column B. (i've shown the example of amy formuala in cell C2, which works great - no issues on this).

What I want to be able to know is: At any date projected date (written in Cell B1), how many months of follow up visits will each patient have completed. The result should go in Column J.

I have tried to use DATEIF. This only partly works, because it calculates the time elapsed between date of treatment and the date in B1, but incorrectly rounds down to the nearest month, rather than ROUNDING DOWN to the last 6 monthly interval. This is why the context is important to note.... because the data generated from each patient is only available to me when that patient actually attends their 6 monthly clinic visit.

For instance, a DATEIF formula between start date (B4) and end date (B1), might generate a result such as "2 yrs 8 months". Though accurate, it is not useful for me, because I would prefer the result to tell me that Patient 001 has progressed through the 30 month (2 years and 6 month) clinic follow up visit.


ABCDEFGHIJ
1Projected date:dd-MMM-YYYY
2monthmonthmonthmonthmonthmonth....
3Patient numberDate of treatment 612 18 24 30 36 .....Amount of Follow up data available
400120-Jun-2012=DATE(YEAR($B4),MONTH($B4)+C3,DAY($B4))?????
500229-Aug-2013

<tbody>
</tbody>


Hope someone out there can help?

Many thanks
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
consider
=LOOKUP(YEARFRAC(B4,B1,1),rTable)

rTable is a named range with the text that you require
one line first column 2 and next "2 Years" without the brackets.
 
Upvote 0
You da man Dave --- Thanks very much .
Worked a treat!

I created a rTable as follows, and used the Lookup formula you suggested.
(in the Vector column, I left out the words "years" or "months", so that I can apply SUBTOTAL or SUM calculations on all the values that are in Column J).

Thanks again,
panesai1



valuevector
00
0.080.08
0.170.17
0.250.25
0.330.33
0.420.42
0.50.5
11
1.51.5
22
2.52.5
33
3.53.5
44
4.54.5
55
5.55.5
66
6.56.5
77
7.57.5
88

<colgroup><col><col></colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,791
Members
451,589
Latest member
Harold14

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top