When should you use a comma before that and which clauses?
Follow four steps to decide:
1. Find the clause beginning with that or which. If the clause begins with a that, omit the comma. If the clause begins with a which, continue to step 2.
a. Example of "that" clause: The only way that Fred could determine the way home was by tracking the position of the sun.
b. Example of "which" clause: Fred found his way home by tracking the position of the sun, which was one of several methods he'd used in the past.
2. Figure out exactly what sentence element the which clause describes or modifies.
a. The solution for insomnia which seemed most promising to the students was listening to Professor Crabbe's lecture on sleep disorders.
b. One solution for insomnia, which seemed most promising to the students, was listening to Professor Crabbe's lecture on sleep disorders.
In both of these examples, the which clause describes Professor Crabbe's lecture on sleep disorders.
3. Ask yourself the following questions:
a. Is the clause necessary to understanding the sentence element it modifies?
b. Does the clause merely add information to, but not define, the sentence element it modifies?
In Example 2a above, which introduces something essential about Professor Crabbe's lecture. You can't really separate the "seemed most promising to the students" part from the rest of the sentence without fundamentally changing the meaning of the sentence.
In Example 2b, the commas that mark off the which clause serve almost the same purpose as parentheses: they bracket a clause that brings additional, nonessential information to the sentence. Here, what the students thought about the lecture does not define it.
4. If the which clause is necessary to understanding the sentence element, do not use a comma. If the which clause merely adds information about the element but does not define it, insert a comma before which and, if the clause does not end the sentence, after the clause.
Remember: That clauses always convey essential information about their subjects and never take commas. Which clauses occasionally convey essential information, and when they do, they do not require commas, either. Most which clauses, however, merely add information, and these require commas.