At issue is whether the trial court erred in scoring offense variable 13 (OV 13) and, if so, whether defendant is entitled to be resentenced. Because we conclude that the trial court did err in scoring OV 13, and because this error affected the statutory sentencing guidelines range, we remand to the trial court for resentencing.
I. FACTS AND PROCEDURAL HISTORY
Following a jury trial, defendant was convicted of first-degree home invasion, MCL 750.110a(2).1 At the sentencing hearing, defendant unsuccessfully challenged the scoring of points under offense variables 9 and 13. The statutory sentencing guidelines, as scored by the trial court, called for a minimum sentence range of 87 to 217 months, and defendant was sentenced to 102 to 480 months as a third-offense habitual offender. Defendant filed an appeal as of right. The Court of Appeals affirmed, unpublished opinion per curiam, issued May 26, 2005 (Docket No. 252188), and defendant applied for leave to appeal in this Court. After directing the parties to address certain issues,2 we heard oral *85argument on whether to grant the application or take other peremptory action permitted by MCR 7.302(G)(1).3
II. STANDARD OF REVIEW
The issues in this case concern the proper interpretation and application of the statutory sentencing guidelines, MCL 777.11 et seq., which are both legal questions that this Court reviews de novo. People v Morson, 471 Mich 248, 255; 685 NW2d 203 (2004).
III. ANALYSIS
A. OV 13
Defendant argues that the trial court erred in scoring OV 13 at 25 points. Twenty-five points are to be scored under OV 13 where “[t]he offense was part of a pattern of felonious criminal activity involving 3 or more crimes against a person.” MCL 777.43(l)(b) (emphasis added). “[A]ll crimes within a 5-year period, including the sentencing offense, shall be counted regardless of whether the offense resulted in a conviction.” MCL 777.43(2)(a). In the instant case, although the sentencing offense took place in 2003, the trial court relied on three felonies that occurred in 1986 to score OV 13 at 25 points.
In People v McDaniel, 256 Mich App 165, 172; 662 NW2d 101 (2003),4 the Court of Appeals held that “any five-year period may be utilized,” observing:
*86The statute clearly refers to “a 5-year period.” The use of the indefinite article “a” reflects that no particular period is referred to in the statute. Had the Legislature intended the meaning defendant assumes, the statute would refer to “the 5-year period immediately preceding the sentencing offense.” Instead, the phrase “including the sentencing offense” modifies “all crimes.” That is, the sentencing offense may be counted as one of the three crimes in a five-year period. That does not, however, preclude consideration of a five-year period that does not include the sentencing offense. [Id. at 172-173 (emphasis in the original).]
The McDaniel dissent, on the other hand, concluded that only a five-year period that includes the sentencing offense can be considered, explaining:
The language at issue states that “all crimes within a 5-year period, including the sentencing offense, shall be counted.” MCL 777.43(2)(a) (emphasis added). Because the word “shall” is used, I find it is impossible for any five-year period that does not include the sentencing offense to be considered. Contrary to the majority’s interpretation of the statute, my reading of the statutory language clearly precludes consideration of a five-year period that does not include the sentencing offense. [Id. at 174 (DONOFRIO, J., dissenting).]
We agree with the Court of Appeals dissent that only those crimes committed during a five-year period that encompasses the sentencing offense can be considered.
MCL 777.43(l)(b) states that the sentencing offense must be “part of a pattern of felonious criminal activity involving 3 or more crimes against a person.” (Emphasis added.) MCL 777.43(2)(a) defines a “pattern” as three or more crimes committed “within a five-year period, including the sentencing offense ....” (Empha*87sis added.) Therefore, in order for the sentencing offense to constitute a part of the pattern, it must be encompassed by the same five-year period as the other crimes constituting the pattern.
The Court of Appeals majority in McDaniel, supra at 172, concluded that because MCL 777.43(2)(a) refers to “a 5-year period,” rather than “the 5-year period,” “any 5-year period may be utilized.” However, MCL 777.43(2)(a) does not just refer to “a 5-year period”; instead, it refers to “a 5-year period, including the sentencing offense . . . .” (Emphasis added.) It is a long-accepted principle of statutory construction that the court must construe a statute so as to give full effect to all its provisions. Drouillard v Stroh Brewery Co, 449 Mich 293, 302; 536 NW2d 530 (1995). The Court of Appeals erred in not considering the language of MCL 777.43(2)(a), above, which specifies that the five-year period must include the sentencing offense.
The Court of Appeals concluded that “the sentencing offense may be counted as one of the three crimes in a five-year period. That does not, however, preclude consideration of a five-year period that does not include the sentencing offense.” McDaniel, supra at 172-173. However, MCL 777.43(2)(a) specifically states that “all crimes within a 5-year period, including the sentencing offense, shall be counted . . . .” (Emphasis added.) “Shall” is a mandatory term, not a permissive one. Burton v Reed City Hosp Corp, 471 Mich 745, 752; 691 NW2d 424 (2005). Because MCL 777.43(2)(a) states that the sentencing offense “shall” be included in the five-year period, the sentencing offense must be included in the five-year period. Therefore, MCL 777.43(2)(a) does preclude consideration of a five-year period that does not include the sentencing offense.
*88In this case, the sentencing offense took place in 2003, while the other offenses took place in 1986. Because the sentencing offense did not encompass the same five-year period as the other offenses, OV 13 was improperly scored at 25 points.
B. RESENTENCING
The trial court sentenced defendant to 102 to 480 months of imprisonment under the belief that the statutory sentencing guidelines set forth a minimum range of 87 to 217 months. However, when the statutory sentencing guidelines are correctly scored, they actually set forth a minimum range of 78 to 195 months. Thus, the trial court sentenced defendant to a minimum of 102 months under a misapprehension of the guidelines range.
A defendant is entitled to be sentenced by a trial court on the basis of accurate information. MCL 769.34(10) states, “[i]f a minimum sentence is within the appropriate guidelines sentence range, the court of appeals shall affirm that sentence and shall not remand for resentencing absent an error in scoring the sentencing guidelines or inaccurate information relied upon in determining the defendant’s sentence.” (Emphasis added.) In other words, if a minimum sentence falls within the appropriate guidelines range, a defendant is not entitled to be resentenced unless there has been a scoring error or inaccurate information has been relied upon. As we explained in People v Kimble, 470 Mich 305, 310-311; 684 NW2d 669 (2004), “if the sentence is within the appropriate guidelines sentence range, it is only appealable if there was a scoring error or inaccurate information was relied upon in determining the sentence and the *89issue was raised at sentencing, in a motion for resentencing, or in a motion to remand.”5
MCL 769.34(10) makes clear that the Legislature intended to have defendants sentenced according to accurately scored guidelines and in reliance on accurate information (although this Court might have presumed the same even absent such express language).6 Moreover, we have held that “a sentence is invalid if it is based on inaccurate information.” People v Miles, 454 Mich 90, 96; 559 NW2d 299 (1997).7 In this case, there was a scoring error, the scoring error altered the appropriate guidelines range, and defendant preserved the issue at sentencing.8 It would be in derogation of the *90law, and fundamentally unfair, to deny a defendant in the instant circumstance the opportunity to be resentenced on the basis of accurate information.9 A defen*91dant is entitled to be sentenced in accord with the law, and is entitled to be sentenced by a judge who is acting in conformity with such law.
The trial court here sentenced defendant to a minimum of 102 months under the misapprehension that the statutory sentencing guidelines called for a minimum sentence of 87 to 217 months; instead, the guidelines, correctly scored, called for a minimum sentence of 78 to 195 months.10 While the difference between the mistaken and the correct guidelines ranges is relatively small, the fundamental problem nonetheless is illustrated. The actual sentence suggests an intention by the trial court to sentence defendant near the bottom of the appropriate guidelines range— specifically, fifteen months or 17 percent above the 87-month minimum. Had the trial court been acting on the basis of the correct guidelines range, however, we simply do not know whether it would have been prepared to sentence defendant to a term 24 months or 30 percent above the new 78-month minimum.11 Indeed, appellate correction of an erroneously calculated guidelines range will always present this dilemma, i.e., the defendant will have *92been given a sentence which stands differently in relationship to the correct guidelines range than may have been the trial court’s intention.12 Thus, requiring resentencing in such circumstances not only respects the defendant’s right to be sentenced on the basis of the law, but it also respects the trial court’s interest in having defendant serve the sentence that it truly intends.13
Because defendant’s sentence here is based upon an inaccurate calculation of the guidelines range and is, therefore, inconsistent with the law, defendant is entitled to be resentenced.14
IV CONCLUSION
Because we conclude that the trial court erred in scoring OV13, and that this error affected the statutory sentencing guidelines range, we remand to the trial court for resentencing pursuant to the correct guidelines range.
TAYLOR, C.J., and Cavanagh, and Kelly, JJ., concurred with MARKMAN, J.Defendant was also convicted of larceny from a building, MCL 750.360, but the trial court vacated this conviction.
These issues were as follows:
(1) [W]hether People v McDaniel, 256 Mich App 165, 172-173 (2003), was correct in deciding that Offense Variable 13 may be scored based on three or more felonies committed in any five-year period even if that period does not include the date of the sentencing offense, and (2) assuming OV 13 should not have been scored, is defendant automatically entitled to resentencing because of the scoring error, or is resentencing unnecessary because the minimum sentence imposed was “within the appropriate *85guidelines sentence range” within the meaning of MCL 769.34(10). [474 Mich 946 (2005).]
474 Mich 946 (2005).
The defendant in McDaniel filed an application for leave to appeal in this Court and we held it in abeyance, 668 NW2d 909 (2003), for People v Kimble, 470 Mich 305; 684 NW2d 669 (2004). After we issued our decision in Kimble, and after we scheduled oral argument on whether to grant the application or take other peremptory action permitted by MCR *867.302(G)(1), 471 Mich 934 (2004), we dismissed the application upon stipulation of the parties. 692 NW2d 387 (2005).
The dissent states that, even assuming that OV 13 was misscored, defendant’s sentence is within the appropriate guidelines sentence range, and “the Legislature has expressly directed an appellate court to affirm in this circumstance.” Post at 93. The Legislature, however, has not expressly directed an appellate court to affirm in this circumstance. Instead, the Legislature has expressly directed an appellate court to affirm where the sentence is within the appropriate guidelines range “absent an error in scoring the sentencing guidelines or inaccurate information relied upon in determining the defendant’s sentence.” MCL 769.34(10) (emphasis added).
Even if MCL 769.34(10) does not, as suggested by the dissent, require a remand, a remand is required by MCR 2.613(A), which provides that an error does not justify disturbing a judgment “unless refusal to take this action appears to the court inconsistent with substantial justice.” It is difficult to imagine something more “inconsistent with substantial justice” than requiring a defendant to serve a sentence that is based upon inaccurate information.
Unlike the dissent, we conclude that when a trial court sentences a defendant in reliance upon an inaccurate guidelines range, it does so in rebanee upon inaccurate information.
Where a scoring error does not alter the appropriate guidelines range, resentencing is not required. People v Davis, 468 Mich 77, 83; 658 NW2d 800 (2003). Resentencing is also not required where the trial court has clearly indicated that it would have imposed the same sentence regardless of the scoring error and the sentence fabs within the appropriate guidehnes range. People v Mutchie, 468 Mich 50, 51; 658 NW2d 154 *90(2003). Finally, if the defendant failed to raise the scoring error at sentencing, in a proper motion for resentencing, or in a proper motion to remand filed in the Court of Appeals, and the defendant’s sentence is within the appropriate guidelines range, the defendant cannot raise the error on appeal except where otherwise appropriate, as in a claim of ineffective assistance of counsel. MCL 769.34(10) (“[a] party shall not raise on appeal an issue challenging the scoring of the sentencing guidelines or challenging the accuracy of information relied upon in determining a sentence that is within the appropriate guidelines sentence range unless the party has raised the issue at sentencing, in a proper motion for resentencing, or in a proper motion to remand filed in the court of appeals”); Kimble, supra at 310-311 (“if the sentence is within the appropriate guidelines sentence range, it is only appealable if there was a scoring error or inaccurate information was relied upon in determining the sentence and the issue was raised at sentencing, in a motion for resentencing, or in a motion to remand”).
The United States Supreme Court has held that “a court of appeals must remand for resentencing[] if the sentence was imposed as a result of an incorrect application of the [federal] Guidelines” and that “a sentence is imposed ‘as a result of’ an incorrect application of the Guidelines when the error results in the district court selecting a sentence from the wrong guidelines range.” Williams v United States, 503 US 193, 202, 203; 112 S Ct 1112; 117 L Ed 2d 341 (1992). As explained by the United States Court of Appeals for the Third Circuit, “[a] defendant has a right to a sentence that not only falls within a legally permissible range, but that was imposed pursuant to correctly applied law” and “imposition of a sentence selected from the wrong range is likely to impair a defendant’s right to a fair sentence .. ..” United States v Knight, 266 F3d 203, 210 (CA 3, 2001). And, as explained by the United States Court of Appeals for the Sixth Circuit:
If the range the court used resulted from an incorrect application of the guidelines, an after-the-fact determination that the sentence actually imposed happened to be within the proper range does not cure the court’s error. The actual sentence imposed in such a case is not material because it is the district court’s application of the guidelines to arrive at the sentencing range that is at issue, not that court’s discretionary choice of sentence within that range. [United States v Lavoie, 19 F3d 1102, 1104 (CA 6, 1994).]
The dissent concludes that, where the trial court sentences a defendant on the basis of an inaccurate guidelines range and where the defendant’s sentence falls within the appropriate guidelines range, the courts should employ the “harmless error” rule. However, the dissent next concludes that because defendant’s sentence falls within the appropriate guidelines range, any error was harmless. What is the point in applying a harmless error rule if the error is always going to be harmless? And, why did the Legislature provide that a sentence that is within the appropriate guidelines range shall be affirmed “absent an error in scoring the sentencing guidelines or inaccurate information relied upon in determining the defendant’s sentence,” MCL 769.34(10), if it intended all sentences that are within the appropriate guidelines to be affirmed, regardless of whether there was an error in scoring the guidelines?
At oral argument, the prosecutor conceded that this case should be remanded for resentencing if OV 13 was determined to be misscored.
Contrary to the dissent, we are in no way suggesting that courts must “engage in a calculus of comparing percentages.” Post at 94. We only mention these percentages to demonstrate how a sentence based on an inaccurate guidelines range may not constitute the sentence that the trial court genuinely intended to impose.
We do not accept the premise that a de minimis violation of a defendant’s rights has occurred, and that resentencing is unnecessary because an error is “harmless,” where a defendant is to be deprived of his or her liberty for “only” a few more months. A convicted person is entitled to serve a term of imprisonment that is no longer than that which is lawful. It is not “harmless error” when a person is to be imprisoned, and deprived of his or her liberty, for “only” two or three more months than has been provided for by law.
Concerning the other appellate issues raised by defendant, we deny leave to appeal with regard to those issues because we are not persuaded that the questions presented should be reviewed by this Court.