
711 N.W.2d 44 (2006)
474 Mich. 82
PEOPLE of the State of MICHIGAN, Plaintiff-Appellee,
v.
Charles Wayne FRANCISCO, Defendant-Appellant.
Docket No. 129035.
Supreme Court of Michigan.
March 23, 2006.
*45 Michael A. Cox, Attorney General, Thomas L. Casey, Solicitor General, David G. Gorcyca, Prosecuting Attorney, Joyce *46 F. Todd, Chief, Appellate Division, and Robert C. Williams, Assistant Prosecuting Attorney, Pontiac, for the people.
State Appellate Defender (by Jacqueline J. McCann and Anne Yantus), Detroit, for the defendant.
MARKMAN, J.
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 argument 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 N.W.2d 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(1)(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 N.W.2d 101 (2003),[4] the Court *47 of Appeals held that "any five-year period may be utilized," observing:
The 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, 662 N.W.2d 101 (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, 662 N.W.2d 101 (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(1)(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 ...." (Emphasis 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, 662 N.W.2d 101, 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 N.W.2d 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, 662 N.W.2d *48 101. 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 N.W.2d 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.
In 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 N.W.2d 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 issue 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, *49 we have held that "a sentence is invalid if it is based on inaccurate information." People v. Miles, 454 Mich. 90, 96, 559 N.W.2d 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 law, and fundamentally unfair, to deny a defendant in the instant circumstance the opportunity to be resentenced on the basis of accurate information.[9] A defendant 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]*50 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 been 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 OV 13, 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, MICHAEL F. CAVANAGH and MARILYN J. KELLY, JJ., concur.
CORRIGAN, J. (dissenting).
I respectfully dissent because I would deny this application for leave to appeal. Consistent with our "harmless error" rule, I would not require a remand for resentencing under MCL 769.34(10) when an *51 original sentence still falls within the sentencing guidelines range upon rescoring.
MCL 769.34(10) does require affirming defendant's sentence but does not require a remand for resentencing. MCL 769.34(10), in relevant part, provides:
If 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.
When a "defendant's minimum sentence is within appropriate guidelines sentence range," the plain text of the statute imposes two commands. The Court of Appeals (1) "shall affirm that sentence" and (2) "shall not remand for resentencing," absent one of two exceptions. Here, defendant's minimum sentence of 102 months, even after adopting the majority view that the appropriate guidelines sentence range is now 78 to 195 months, still falls within the appropriate guidelines sentence range. Accordingly, the Legislature has expressly directed an appellate court to affirm in this circumstance.
The Legislature has further expressly barred a remand for resentencing, absent one of two exceptions. No one suggests that the second statutory exception for "inaccurate information" applies here.[1] The remaining exception is for "an error in scoring the sentencing guidelines." Assuming arguendo that the majority has correctly interpreted the scoring requirements for offense variable 13, the statute still does not require a remand. The directive in MCL 769.34(10) not to remand unless a condition occurs does not metamorphose into a directive to remand when that condition occurs. The language is permissive in that it describes two conditions when an appellate court may remand, but the appellate court retains discretion with regard to whether remand is warranted. This accords with our "harmless error" rule, under which even an error in a ruling may not justify disturbing a judgment.[2]
In the interest of giving full meaning to the terms of the statute, I would affirm defendant's sentence. The Legislature clearly directed that an appellate court affirm "[i]f a minimum sentence is within the appropriate guidelines sentence range...." That the Legislature also provided that an appellate court could remand on the basis of a scoring error in no way provides a mandate that an appellate court must remand. In the absence of greater clarity in the statute, I would not suggest that lower courts engage in a calculus of comparing percentages. Rather, I would trust the lower courts to employ the "substantial justice" standard of our harmless error rule. Here, any error is harmless because defendant's original sentence of 102 months, which derived from the original guidelines sentencing range of 87 to *52 217 months, still falls well within the post-McDaniel range of 78 to 195 months.
Accordingly, I would conclude that any error in scoring defendant's guidelines sentencing range was harmless, because his original sentence remained within the guidelines range upon rescoring. I respectfully dissent.
WEAVER and YOUNG, JJ., concur.
NOTES
[1]  Defendant was also convicted of larceny from a building, MCL 750.360, but the trial court vacated this conviction.
[2]  These issues were as follows:

(1) [W]hether People v. McDaniel, 256 Mich.App. 165, 172-173, 662 N.W.2d 101 (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 guidelines sentence range" within the meaning of MCL 769.34(10). [474 Mich. 946, 706 N.W.2d 201 (2005).]
[3]  474 Mich. 946, 706 N.W.2d 201 (2005).
[4]  The defendant in McDaniel filed an application for leave to appeal in this Court and we held it in abeyance, 668 N.W.2d 909 (2003), for People v. Kimble, 470 Mich. 305, 684 N.W.2d 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 7.302(G)(1), 471 Mich. 934, 690 N.W.2d 97 (2004), we dismissed the application upon stipulation of the parties. 692 N.W.2d 387 (2005).
[5]  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 51. 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).
[6]  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.
[7]  Unlike the dissent, we conclude that when a trial court sentences a defendant in reliance upon an inaccurate guidelines range, it does so in reliance upon inaccurate information.
[8]  Where a scoring error does not alter the appropriate guidelines range, resentencing is not required. People v. Davis, 468 Mich. 77, 83, 658 N.W.2d 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 falls within the appropriate guidelines range. People v. Mutchie, 468 Mich. 50, 51, 658 N.W.2d 154 (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, 684 N.W.2d 669 ("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").
[9]  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 U.S. 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 F.3d 203, 210 (C.A.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 F.3d 1102, 1104 (C.A.6, 1994).]
[10]  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?
[11]  At oral argument, the prosecutor conceded that this case should be remanded for resentencing if OV 13 was determined to be misscored.
[12]  Contrary to the dissent, we are in no way suggesting that courts must "engage in a calculus of comparing percentages." Post at 51. 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.
[13]  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.
[14]  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.
[1]  Unlike People v. Miles, 454 Mich. 90, 96, 559 N.W.2d 299 (1997), in which our Court remanded when a presentence report did not disclose a prior conviction, the instant case does not turn on a factual determination but on the legal interpretation of a statute. See also id. at 96-97, 559 N.W.2d 299 (citing other cases where errors arose from inaccurate information).
[2]  MCR 2.613(A) provides:

Harmless Error. An error in the admission or the exclusion of evidence, an error in a ruling or order, or an error or defect in anything done or omitted by the court or by the parties is not ground for granting a new trial, for setting aside a verdict, or for vacating, modifying, or otherwise disturbing a judgment or order, unless refusal to take this action appears to the court inconsistent with substantial justice.
