Half-life calculator WITH redosing

JakkeJakobsen

Board Regular
Joined
Sep 10, 2014
Messages
94
I'm trying to make an elimination half-life calculator (for medications and such, can use the basic one without redosing for radioactive decay too).

The formula for a basic half-life calculator is easy enough, but when you want to add redosing, its hard.

The thought behind was to be able to add redosing at irregular intervals as well as regular intervals. Say that you take your meds 08:00 and 16:00, so 10h apart, then nothing untill the next day, or 08:00 and 20:00 (12h), a regular interval.

And also, for one time use, with single or double redose after set amount of time, just to see what levels you'd end up on.

Got this idea after I talked to a friend on antidepressants, where you have to decrease over time, unless you want to go into a full-blown depression and possibly kill yourself... Half-time of that medication is 26h, and you take it every 24h, which sounds odd, as it would increase the amount you have in your body for every day. I am obviously missing something here, that the body does so it doesn't increase every day, but that is another story!

Cheers for all input!
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
this function will calculate an exponential decay, with a halflife

If you use this with a row for each hour or minute that you want the calculation and then just add the extra dose to the previous decayed value the function will then decay both
Code:
Function Halflife(HF, Lasttime, Drive)
If Not (IsNumeric(Period)) Then
  Halflife = "This functions calculates the halflife decay, it has three parameters: halflife, The last time Value of the decay, the latest value of variable"
Else
    TC = 0.69314718055995 / HF
    Halflife = Lasttime + TC * (Drive - Lasttime)
End If
End Function


' log (2) base e=0.69314718055995
 
Upvote 0
this function will calculate an exponential decay, with a halflife

If you use this with a row for each hour or minute that you want the calculation and then just add the extra dose to the previous decayed value the function will then decay both
Code:
Function Halflife(HF, Lasttime, Drive)
If Not (IsNumeric(Period)) Then
  Halflife = "This functions calculates the halflife decay, it has three parameters: halflife, The last time Value of the decay, the latest value of variable"
Else
    TC = 0.69314718055995 / HF
    Halflife = Lasttime + TC * (Drive - Lasttime)
End If
End Function


' log (2) base e=0.69314718055995
I found me a way for calculating two redoses, could make redose 1 and 2 looped ones if i cba to do it.

And, I never say it because there is little that lacks in GSheets compared to Excel. The scripting, different language. I will try and translate it at work tomorrow. My way with only formulas does the trick, but it isn't exactly simple, so.
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,151
Members
453,021
Latest member
Justyna P

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