Tabellab
Data, tech, science & health

Time in range calculation: TIR from CGM data in Excel

Time in range (TIR) is the share of glucose readings between 70 and 180 mg/dL (3.9–10.0 mmol/L), both limits included. Count the readings in the band and divide by all readings: =COUNTIFS(B2:B25,">=70",B2:B25,"<=180")/COUNT(B2:B25). In the example day below, 16 of 24 readings are in range, so TIR = 66.7%, or 16.0 hours a day. The same sheet gives time below range (8.3%) and time above range (25.0%).

Updated 21 Oct 2026 5 min read By Tabellab team

The time in range formula

TIR (%) = readings from 70 to 180 mg/dL ÷ all valid readings × 100

Because a continuous glucose monitor (CGM) takes readings at fixed intervals, usually every 5 minutes, the share of readings equals the share of time. One day has 1,440 minutes, so a 5-minute sensor should deliver 288 readings. TIR × 24 turns the percentage into hours: 70% is 16.8 hours a day.

The example uses one reading per hour so that the whole day fits on screen. With real 5-minute data the formula is the same, only the range is longer.

Worked example: one day of readings, five bands

One synthetic glucose reading per hour (yellow inputs). Column C labels each reading, and rows 27 to 32 calculate the time in each band with COUNTIF and COUNTIFS.

Worked example: one day of readings, five bands
ABC
1TimeGlucose (mg/dL)Band
200:00112In range
301:0098In range
402:0084In range
503:0066Low
604:0052Very low
705:0075In range
806:00104In range
907:00138In range
1008:00196High
1109:00232High
1210:00174In range
1311:00142In range
1412:00128In range
1513:00188High
1614:00214High
1715:00162In range
1816:00131In range
1917:00119In range
2018:00156In range
2119:00205High
2220:00262Very high
2321:00180In range
2422:00147In range
2523:0070In range
26
27Time in range (70–180 mg/dL)66.7%
28Time below range (<70)8.3%
29Time below 54 (level 2)4.2%
30Time above range (>180)25.0%
31Time above 250 (level 2)4.2%
32Hours in range per day16.0
Key formulas
  • C2=IF(B2<54,"Very low",IF(B2<70,"Low",IF(B2<=180,"In range",IF(B2<=250,"High","Very high"))))Band label for one reading
  • C27=COUNTIFS(B2:B25,">=70",B2:B25,"<=180")/COUNT(B2:B25)Time in range, limits included
  • C28=COUNTIF(B2:B25,"<70")/COUNT(B2:B25)Time below range, includes below 54
  • C30=COUNTIF(B2:B25,">180")/COUNT(B2:B25)Time above range, includes above 250
  • C32=C27*24Time in range in hours per day

Synthetic readings of a fictional person, one per hour for readability. Educational only, not medical advice: glucose targets are set individually with a qualified clinician.

In range, below and above: the five bands

The 2019 International Consensus on Time in Range reports five bands next to each other:

  • Time below 54 mg/dL (level 2 low): =COUNTIF(B2:B25,"<54")/COUNT(B2:B25) = 4.2%
  • Time below 70 mg/dL (all lows, including those below 54): 8.3%
  • Time in range 70–180 mg/dL: 66.7%
  • Time above 180 mg/dL (all highs, including those above 250): 25.0%
  • Time above 250 mg/dL (level 2 high): 4.2%

The bands overlap on purpose: below 70 already contains below 54. So below 70 + in range + above 180 = 8.3% + 66.7% + 25.0% = 100%, which is a useful check. Do not add the level 2 bands on top.

Inclusive limits matter

A reading of exactly 70 or exactly 180 is in range. That is why the formula uses ">=70" and "<=180", while time below range uses a strict "<70" and time above range a strict ">180". The example day contains a 70 at 23:00 and a 180 at 21:00 to test exactly this. Use > and < in the TIR formula and the result drops to 58.3%, while the three bands no longer add up to 100%.

The general consensus targets

For most adults with type 1 or type 2 diabetes, the consensus suggests these general targets: TIR above 70%, below 70 under 4%, below 54 under 1%, above 180 under 25% and above 250 under 5%. Older or high-risk adults and pregnancy have different targets, and a care team may set individual ones.

Against the general targets, the example day misses on TIR (66.7%) and on both low bands (8.3% and 4.2%), and sits right at the limit above 180 (25.0%, not under 25%). One day is not enough to judge, though. The consensus recommends looking at 14 days with at least 70% of the expected readings, which is a data sufficiency check before any metric is reported.

mmol/L, mean glucose and GMI

With readings in mmol/L, the band is 3.9 to 10.0 and the formula becomes =COUNTIFS(B2:B25,">=3.9",B2:B25,"<=10")/COUNT(B2:B25). To convert, divide mg/dL by 18 (more precisely 18.016).

TIR usually appears next to two more numbers: the mean glucose and the glucose management indicator, GMI (%) = 3.31 + 0.02392 × mean glucose in mg/dL, which estimates an HbA1c-like value from CGM data. Variability is measured with the coefficient of variation, standard deviation ÷ mean, where a value of 36% or less is generally considered stable. Counting how often a reading falls into a band is the same idea as building a histogram in Excel.

Common mistakes

  • Strict limits in the TIR formula. ">70" and "<180" drop the readings of exactly 70 and 180. Here TIR would fall from 66.7% to 58.3%.
  • Adding the level 2 bands twice. Below 70 already includes below 54, and above 180 includes above 250. Only below 70 + in range + above 180 add up to 100%.
  • Dividing by the expected readings instead of the actual ones. TIR uses COUNT of the valid readings. The expected 288 a day belongs to the data sufficiency check.
  • Mixing units. A band of 70–180 applied to mmol/L readings puts every value below range. Use 3.9–10.0 for mmol/L.
  • Judging from one day. One day is a snapshot. The consensus metrics are meant for about 14 days with at least 70% of the expected data.
  • Counting text or error values. Sensor exports sometimes contain "LOW", "HIGH" or blanks. COUNT ignores text, so decide how to treat those entries before calculating.

Frequently asked questions

How is time in range calculated?

Count the glucose readings from 70 to 180 mg/dL, limits included, and divide by the number of valid readings. With readings every 5 minutes the share of readings equals the share of time, so 200 of 288 readings is 69.4%, or about 16.7 hours.

What is a good time in range?

For most adults with type 1 or type 2 diabetes, the 2019 international consensus suggests more than 70% in range, less than 4% below 70 mg/dL and less than 1% below 54 mg/dL. Targets differ for older or high-risk adults and in pregnancy, and individual targets come from the care team.

How many hours is 70% time in range?

70% of 24 hours is 16.8 hours a day, or 16 hours and 48 minutes. Each 1% of time in range is about 14.4 minutes a day.

What is time in range in mmol/L?

3.9 to 10.0 mmol/L, which matches 70 to 180 mg/dL. Below range is under 3.9 mmol/L, level 2 below is under 3.0 mmol/L, and above range is over 10.0 mmol/L.

Practise it in a lab

Related guides

Reading is step one. Doing is step two.

Every guide links to a lab where you build the same calculation in an online spreadsheet and get instant feedback.

Open the lab