I'm trying to add up all staff hours from different sections of work seperately. I have 1 column of numbers for the amount of time worked, but sometimes there is more than one staff member on a section of work so the names are in two columns. I just want to get the total of all hours worked for a member of staff when their name is in the same row as a number, but it will currently only add up the hours when the name is in the first column not if it's in the second one.

At the base of the sheet I currently have a list of all staff names and then columns for HS work, DCH work, admin, DC etc as the pay rates are different.
for the HS and DCH work next to each staff member I have the formula:

=SUMIF($F:$G,"JOBLOGGS",D:D)

(- note - I actually have each staff name in each one)
but it only adds up the hours from column D if the name appears in column F not G.

Please can someone help I'm stumped and feel like it shouldn't be that tricky but for the life of me can't get it to work. If I try having two columns with the same formula but one just for column F and one for column G it still doesn't add up hours if the same appears in column G.

There needs to be 2 columns as often 2 staff members go to the same call.

There seems to be lots of formulas for adding up multiple columns of numbers to match one name, but not adding up numbers from one column from 2 columns of the name, and they don't seem to be working for me in reverse.

I have attached a sample page (note all names are changed for confidentiality)Book1.xlsx

Any help would be greatly appreciated.