
426 N.W.2d 639 (1988)
STATE of Iowa, Plaintiff-Appellee,
v.
Rodney L. ADCOCK, Defendant-Appellant.
No. 87-180.
Court of Appeals of Iowa.
May 31, 1988.
Charles L. Harrington, Appellate Defender, and James R. Huff, Asst. Appellate Defender, for defendant-appellant.
Thomas J. Miller, Atty. Gen., Julie Ann Halligan, Asst. Atty. Gen., and Stephen J. Petersen, Muscatine Co. Atty., for plaintiff-appellee.
Heard by OXBERGER, C.J., and DONIELSON and SCHLEGEL, JJ.
SCHLEGEL, Judge.
The defendant, Rodney L. Adcock, was charged with attempted murder of Jim Phillips, and in the same information, was charged with willful injury of Jeff Phillips. The jury acquitted Adcock of the willful injury of Jeff Phillips, but found him guilty of willful injury of Jim Phillips, as a lesser-included offense of attempted murder. Adcock appeals that conviction, claiming that the court erred in submitting willful injury as a lesser-included offense of attempted murder. We reverse.
While the State concedes that willful injury is not an included offense of attempted murder, it claims that the error was harmless, and that the conviction should stand.
Attempted murder is defined by Iowa Code section 707.11 as follows:
A person commits a class "B" felony when, with the intent to cause the death of another person and not under circumstances which would justify the persons actions, the person does any act by which the person expects to set in motion a force or chain of events which will cause or result in the death of the other person.
It is not a defense to an indictment for attempt to commit murder that the acts proved could not have caused the death of any person, provided that the actor intended to cause the death of some person by so acting, and the actor's expectations *640 were not unreasonable in the light of the facts known to the actor.
Iowa Code § 707.11 (1985).
Willful injury is defined as follows:
Any person who does an act which is not justified and which is intended to cause and does cause serious injury to another commits a class "C" felony.
Iowa Code § 708.4 (1985).
The defendant and the State are correct that willful injury is not an included offense of attempted murder. It is clear that the test for finding of an included offense is not satisfied with these offenses. The Iowa Supreme Court has stated:
In determining what offenses are lesser and included, we have developed a factual and legal test for the trial courts to apply. State v. Sangster, 299 N.W.2d 661, 663 (Iowa 1980). For an affirmative finding of an included offense, both tests must be satisfied. Id.

The legal or element test requires the lesser offense to be composed solely of some but not all of the elements of the greater offenses. Id. Thus, the lesser offense is necessarily included in the greater offense if the greater offense cannot be committed without also committing the lesser. State v. Redmon, 244 N.W.2d 792, 801 (Iowa 1976). Conversely, if the lesser offense contains an element that is not part of the greater offense, the lesser cannot be included in the greater. Sangster, 299 N.W.2d at 663.
The factual test requires the court to determine whether there is a sufficient factual basis in the record for submitting the included offense. Id.

State v. Lampman, 345 N.W.2d 142, 143 (Iowa 1984). In the case before us, it is obvious that willful injury does not satisfy the legal or element test for a lesser-included offense. The lesser offense is not necessarily included in the greater offense, because the greater offense (attempted murder) can be committed without also committing the lesser offense (willful injury). Attempted murder does not necessarily include serious injury, which is essential to willful injury. See Iowa Code § 708.4 (1985).
Since willful injury is not an included offense of attempted murder, Adcock was found guilty of a crime for which he was not charged. A formal accusation is essential for every trial of a crime. State v. Meyers, 256 Iowa 801, 805, 129 N.W.2d 88, 91 (1964). A conviction without a formal accusation is a nullity. See State v. Bartlett, 181 Iowa 436, 438-40, 164 N.W. 757, 758 (1917). Failure of a trial information to charge an offense is akin to a lack of subject-matter jurisdiction. Cf. State v. Trucke, 410 N.W.2d 242, 243 n. 1 (Iowa 1987).
Based upon these rules if a defendant is not formally charged with an offense, or if the offense of which he is found guilty is neither charged nor an included offense, then he is found guilty of an offense without a formal charge and his conviction is a nullity.
The State argues that the included offense may be established by evidence adduced at trial in proof of the greater offense. Evidence was adduced that the defendant caused serious injury. However, absent willful injury being an included offense to attempted murder, the defendant's conviction was without a formal charge and is therefore a nullity. The State, by this assertion, argues that the case satisfies the factual test as to whether willful injury is an included offense. The factual test is only one part of the test to determine whether the offense is a lesser-included one. Whether it satisfies the legal or element test is determined by the statute. State v. Sangster, 299 N.W.2d 661, 663 (Iowa 1980); State v. Redmon, 244 N.W.2d 792, 801 (Iowa 1976). In this case, the offense of willful injury does not meet the legal or element test as being a lesser-included offense of attempted murder. Accordingly, we must reverse the defendant's conviction of willful injury.
REVERSED.
