Help with formula to calculate sum after searching multiple colums

Lcollins

New Member
Joined
Feb 21, 2017
Messages
4
Hopefully someone can shed some light. I am trying to findthe number of hours a person worked for the month. In my spreadsheet I want theformula to look through the range for cells where staff were assigned to work(Columns E-J, Rows 2-8). Each time a particular person is named in that range(ie... David in cells F3 and E6) I would like the formula to add the hoursworked in column D. David worked 8 hours on Jan 1 and 7 hours on Jan 3.<o:p></o:p>
<o:p></o:p>
<o:p></o:p>
Date<o:p></o:p>
Customer<o:p></o:p>
# of<o:p></o:p>
staff<o:p></o:p>
hrs <o:p></o:p>
worked<o:p></o:p>
Staff utilized<o:p></o:p>
1-Jan<o:p></o:p>
Mr. Davis<o:p></o:p>
1<o:p></o:p>
8<o:p></o:p>
Tim<o:p></o:p>
1-Jan<o:p></o:p>
Mrs. Jones<o:p></o:p>
2<o:p></o:p>
5<o:p></o:p>
John<o:p></o:p>
David<o:p></o:p>
2-Jan<o:p></o:p>
Coolridge Apts<o:p></o:p>
5<o:p></o:p>
8<o:p></o:p>
William<o:p></o:p>
Bobby<o:p></o:p>
Brian<o:p></o:p>
Jim<o:p></o:p>
Dave<o:p></o:p>
3-Jan<o:p></o:p>
Hamilton HOA<o:p></o:p>
4<o:p></o:p>
6<o:p></o:p>
Brian<o:p></o:p>
Sal<o:p></o:p>
Billy<o:p></o:p>
John<o:p></o:p>
3-Jan<o:p></o:p>
Meadow Lark Apts<o:p></o:p>
6<o:p></o:p>
7<o:p></o:p>
David<o:p></o:p>
Tom<o:p></o:p>
Will<o:p></o:p>
Mike<o:p></o:p>
John<o:p></o:p>
4-Jan<o:p></o:p>
Mr. Williams<o:p></o:p>
3<o:p></o:p>
3.5<o:p></o:p>
Tim<o:p></o:p>
Jim<o:p></o:p>
John<o:p></o:p>
5-Jan<o:p></o:p>
City Park<o:p></o:p>
6<o:p></o:p>
10<o:p></o:p>
John<o:p></o:p>
Dave<o:p></o:p>
Mark<o:p></o:p>
Will<o:p></o:p>
Mike<o:p></o:p>
Jim<o:p></o:p>

<tbody>
</tbody>
<o:p></o:p>
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
*CD
12David12

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:61px;"><col style="width:76px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
D12=SUMPRODUCT(D2:D8*(E2:J8=C12))

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Last edited:
Upvote 0
I'll admit I don't understand the formula you provided. When I plug the formula into a cell is says David worked 97.5 hours. Maybe I did something wrong.

I'm looking for a formula which will look through all of the staff who worked during the time frame (cells in the range of E2 to J8) and find the name "David" in each of those cells. Each time "David" is listed in the cell range of E2 through J8, I want the formula to take the hours worked on that particular day (found the F column of the corresponding row) and add them together. David is listed as working in cells F3 and E6, showing he worked on Jan 1 and Jan 3. I would like the formula to then look at the corresponding number of hours worked each of those days (5 hrs on Jan 1 - cell D3 and 7 hrs on Jan 3 - cell D6). David, thus worked 12 hrs. Does this make sense?

Using the same logic, John worked 5 times during this time frame for 31.5 hrs.
 
Upvote 0
When I put david in C12 it gives me 12 and 31.5 for John. I think you haven't selected the proper cell.
The below highlighted part of the formula has to be adjusted according to your data.
You can either give a reference to a cell where the name of a person whose data has to be summed or write David or any person's name manually in your formula as shown in below formula.

=SUMPRODUCT(D2:D8*(E2:J8=C12))
OR
=SUMPRODUCT(D2:D8*(E2:J8="David"))

<tbody>
</tbody>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,491
Messages
6,125,110
Members
449,205
Latest member
ralemanygarcia

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top