chadlaw32

Board Regular
Joined
Jul 29, 2014
Messages
84
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
I need to look up the sup total or Over time based on the name. Example i want to put Doe, John in a cell and have it bring me 0.77, any ideas?


Pay DatePay CodeHoursDollars
DoeJaneYG6001144
Sun 03/31/2019REGULAR-Regular0.27XXXX
Mon 04/01/2019REGULAR-Regular7.37XXXX
Tue 04/02/2019REGULAR-Regular8.28XXXX
Wed 04/03/2019REGULAR-Regular7.83XXXX
Thu 04/04/2019VACATION-VACATION8XXXX
Fri 04/05/2019REGULAR-Regular4.87XXXX
Subtotal36.62XXXX
DoeJohnYG6001457
Mon 04/01/2019REGULAR-Regular7.05XXXX
Tue 04/02/2019REGULAR-Regular7.65XXXX
Wed 04/03/2019REGULAR-Regular8.37XXXX
Thu 04/04/2019REGULAR-Regular9.35XXXX
Fri 04/05/2019OVERTIME-Overtime0.77XXXX
Fri 04/05/2019REGULAR-Regular7.58XXXX
Subtotal40.77XXXX

<colgroup><col><col span="4"><col><col><col span="3"><col><col span="3"><col><col span="2"><col></colgroup><tbody>
</tbody>
 
Try this



ABCDEFGH
1Pay DatePay Code HoursDollars NameOVERTIME-Overtime
2DoeDavidYG6001144 Doe, John11.14
3Sun 03/31/2019REGULAR-Regular 0.27XXXX
4Mon 04/01/2019REGULAR-Regular 7.37XXXX
5Tue 04/02/2019OVERTIME-Overtime 8.28XXXX
6Wed 04/03/2019REGULAR-Regular 7.83XXXX
7Thu 04/04/2019OVERTIME-Overtime 8XXXX
8Fri 04/05/2019REGULAR-Regular 4.87XXXX
9 Subtotal36.62XXXX
10DoeJohnYG6001457
11Mon 04/01/2019REGULAR-Regular 7.05XXXX
12Tue 04/02/2019REGULAR-Regular 7.65XXXX
13Wed 04/03/2019OVERTIME-Overtime 8.37XXXX
14Thu 04/04/2019REGULAR-Regular 9.35XXXX
15Fri 04/05/2019OVERTIME-Overtime 2.77XXXX
16Fri 04/05/2019REGULAR-Regular 7.58XXXX
17 Subtotal40.77XXXX

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:101.7px;"><col style="width:137.82px;"><col style="width:67.49px;"><col style="width:39.92px;"><col style="width:41.82px;"><col style="width:35.17px;"><col style="width:76.04px;"><col style="width:129.27px;"></colgroup><tbody>
</tbody>

CellFormula
H2{=SUMIF(OFFSET(B1,MATCH(SUBSTITUTE(G2,", ",""),A1:A17&B1:B17,0)-1,0,MATCH("Subtotal",OFFSET(C1,MATCH(SUBSTITUTE(G2,", ",""),A1:A17&B1:B17,0),0,17),0)),H1,OFFSET(D1,MATCH(SUBSTITUTE(G2,", ",""),A1:A17&B1:B17,0)-1,0,MATCH("Subtotal",OFFSET(C1,MATCH(SUBSTITUTE(G2,", ",""),A1:A17&B1:B17,0),0,17),0)))}

<tbody>
</tbody>

<tbody>
</tbody>

That's exactly what he does in my example:confused:
 
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
It does but it also populates the answer from the first cell in any following cells with a blank cell reference.
 
Upvote 0
Then you could give the example of the result that the formula puts, even better, you could upload your file and show me with examples.

You could upload a copy of your file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. If the workbook contains confidential information, you could replace it with generic data.
 
Upvote 0
Here is an example all the cells below Sarah have no name so it just pulls the same answer for whatever name is in the first cell in this case Doe, John below is the formula I am using

=IFERROR(SUMIF(OFFSET($F$1,MATCH(SUBSTITUTE(T2,", ",""),$A:$A&$F:$F,0)-1,0,MATCH("Subtotal",OFFSET($K$1,MATCH(SUBSTITUTE(T2,", ",""),$A:$A&$F:$F,0),0,17),0)),$U$1,OFFSET($O$1,MATCH(SUBSTITUTE(T2,", ",""),$A:$A&$F:$F,0)-1,0,MATCH("Subtotal",OFFSET($K$1,MATCH(SUBSTITUTE(T2,", ",""),$A:$A&$F:$F,0),0,17),0))),"")


Employee Daily Totals ReportSupportOVERTIME-Overtime
Date Range: 03/31/2019 - 04/06/2019 and Employee Effective As Of : 04/09/2019Doe, John0.77
Company Code:Brown, Sarah0
Last Name First NamePosition ID 0.77
Pay Date Pay Code Hours Dollars 0.77
0.77
Doe John 0.77
########## REGULAR-Regular7.48XXXX 0.77
########## REGULAR-Regular7.47XXXX 0.77
########## REGULAR-Regular7.82XXXX 0.77
########## OVERTIME-Overtime0.77XXXX 0.77
########## REGULAR-Regular8.10XXXX 0.77
########## LWOP-Leave Without Pay8.00XXXX 0.77
Subtotal46.99XXXX 0.77
Total9.24
Brown Sarah
########## REGULAR-Regular0.27XXXX OVERTIME-Overtime
########## REGULAR-Regular7.37XXXX 0.77
########## REGULAR-Regular8.28XXXX 0.77
########## REGULAR-Regular7.83XXXX 0.77
########## VACATION-VACATION8.00XXXX 0.77
########## REGULAR-Regular4.87XXXX 0.77
Subtotal36.62XXXXTotal3.85

<colgroup><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col span="2"><col><col><col><col></colgroup><tbody>
</tbody>
 
Upvote 0
But you modified the formula, that's not the formula that I gave you.

=SUMIF(OFFSET(B1,MATCH(SUBSTITUTE(G2,", ",""),A1:A17&B1:B17,0)-1,0,MATCH("Subtotal",OFFSET(C1,MATCH(SUBSTITUTE(G2,", ",""),A1:A17&B1:B17,0),0,17),0)),H1,OFFSET(D1,MATCH(SUBSTITUTE(G2,", ",""),A1:A17&B1:B17,0)-1,0,MATCH("Subtotal",OFFSET(C1,MATCH(SUBSTITUTE(G2,", ",""),A1:A17&B1:B17,0),0,17),0)))

Change 17 by the number of last row.

Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself


 
Upvote 0
i had to adjust the column for the sheet I am using and I did a CTRL SHIFT ENTER to get the {} around it in the sheet. It pulls the correct info if i have a name in the reference cell but if that cell is empty to allow for adding names later it pulls the data for the first name on the list.
 
Upvote 0
But the idea is to put a name.
If the cell is blank then it should return blank?

Try:

=IF(G2="","",SUMIF(OFFSET(B1,MATCH(SUBSTITUTE(G2,", ",""),A1:A17&B1:B17,0)-1,0,MATCH("Subtotal",OFFSET(C1,MATCH(SUBSTITUTE(G2,", ",""),A1:A17&B1:B17,0),0,17),0)),H1,OFFSET(D1,MATCH(SUBSTITUTE(G2,", ",""),A1:A17&B1:B17,0)-1,0,MATCH("Subtotal",OFFSET(C1,MATCH(SUBSTITUTE(G2,", ",""),A1:A17&B1:B17,0),0,17),0))))
 
Upvote 0
That worked like a champ thank you for all your help you are awesome!!
 
Upvote 0

Forum statistics

Threads
1,215,267
Messages
6,123,964
Members
449,137
Latest member
yeti1016

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