F
FatKat
Greetings. I am a NYC criminal attorney who uses Excel for a lot of
my case-management. I've recently found that formula that allows you
to calculate the time between two dates
("=YEAR(I45)-YEAR(R45)-
IF(OR(MONTH(I45)<MONTH(R45),AND(MONTH(I45)=MONTH(R45),
DAY(I45)<DAY(R45))),1,0)&" years, "&MONTH(I45)-
MONTH(R45)+IF(AND(MONTH(I45)<=MONTH(R45),DAY(I45)<DAY(R45)),
11,IF(AND(MONTH(I45)<MONTH(R45),DAY(I45)>=DAY(R45)),
12,IF(AND(MONTH(I45)>MONTH(R45),DAY(I45)<DAY(R45)),-1)))&" months,
"&I45-DATE(YEAR(I45),MONTH(I45)-IF(DAY(I45)<DAY(R45),1,0),DAY(R45))&"
days"")
broken down in years, months, and days. I use that information to
calculate the periods of time in which a criminal defendant is held in
custody.
FYI - this is important because under my state's sentencing laws, a
person charged with committing a felony is subject to mandatory
minimum jail sentences of at least a year if they have been previously
convicted of a felony in the past 10 years - the critical part is that
any subsequent periods of time spent by that person in custody (even
in local lock-ups for misdemeanors) is excluded from calculations of
the 10 year period. This happens quite frequently as you can
imagine. I use the above formula to calculate the length of each
period, but haven't figured out a way to add the separate periods
themselves.
I know I'm missing something simple.
Suggestions warmly appreciated.
my case-management. I've recently found that formula that allows you
to calculate the time between two dates
("=YEAR(I45)-YEAR(R45)-
IF(OR(MONTH(I45)<MONTH(R45),AND(MONTH(I45)=MONTH(R45),
DAY(I45)<DAY(R45))),1,0)&" years, "&MONTH(I45)-
MONTH(R45)+IF(AND(MONTH(I45)<=MONTH(R45),DAY(I45)<DAY(R45)),
11,IF(AND(MONTH(I45)<MONTH(R45),DAY(I45)>=DAY(R45)),
12,IF(AND(MONTH(I45)>MONTH(R45),DAY(I45)<DAY(R45)),-1)))&" months,
"&I45-DATE(YEAR(I45),MONTH(I45)-IF(DAY(I45)<DAY(R45),1,0),DAY(R45))&"
days"")
broken down in years, months, and days. I use that information to
calculate the periods of time in which a criminal defendant is held in
custody.
FYI - this is important because under my state's sentencing laws, a
person charged with committing a felony is subject to mandatory
minimum jail sentences of at least a year if they have been previously
convicted of a felony in the past 10 years - the critical part is that
any subsequent periods of time spent by that person in custody (even
in local lock-ups for misdemeanors) is excluded from calculations of
the 10 year period. This happens quite frequently as you can
imagine. I use the above formula to calculate the length of each
period, but haven't figured out a way to add the separate periods
themselves.
I know I'm missing something simple.
Suggestions warmly appreciated.