If you're using named table notation:
| PersonID | Hours | Jobcode | Total |
|---|---|---|---|
| 1 | 7 | 1 | 7 |
| 1 | 6 | 2 | 13 |
| 1 | 8 | 3 | 21 |
| 1 | 10 | 1 | 31 |
| 2 | 4 | 1 | 4 |
| 2 | 12 | 2 | 16 |
| 2 | 5 | 3 | 21 |
| 2 | 3 | 5 | 24 |
With the following formula for Total:
=SUMIF(INDEX([PersonID],1):[@PersonID],[@PersonID],INDEX([Hours],1):[@Hours])