To get the sum of column D (hours) where column B (account number) is 9, you can use this formula in cell D12:
Code:
=SUMIF(B4:B9,9,D4:D9)
To get the sum of column E (amount) where column B (account number) is 9, you can use this formula in cell E12:
Code:
=SUMIF(B4:B9,9,E4:E9)
To get the sum of column D (hours) where column B (account number) is not equal to 9, you could use either of these formulas:
Code:
=SUMIF(B4:B9,"<>9",D4:D9)
=D14-D12
To get the sum of column E (hours) where column B (account number) is not equal to 9, you could use either of these formulas:
Code:
=SUMIF(B4:B9,"<>9",E4:E9)
=E14-E12
Instead of typing the constant "9" in the formula, you could put it in a cell and reference that cell. This is generally considered to be better practice: if you change cell C12 to 9 instead of Acct 9 Total then the formulas would be:
Code:
=SUMIF(B4:B9,C12,D4:D9)
=SUMIF(B4:B9,C12,E4:E9)
=SUMIF(B4:B9,"<>"&C12,D4:D9)
=SUMIF(B4:B9,"<>"&C12,E4:E9)
etc...