IF Statement with Vlookup, largest amount

calinini

New Member
Joined
Jul 13, 2015
Messages
9
Hello!

I'm hoping for help on a formula.

Here is my source data:

[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[TD]K[/TD]
[TD]L[/TD]
[TD]M[/TD]
[TD]N[/TD]
[TD]O[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Employee ID[/TD]
[TD]Name[/TD]
[TD]JobCode[/TD]
[TD]Jobtitle[/TD]
[TD]Store Number[/TD]
[TD]Secondary Store[/TD]
[TD]Hire Dt[/TD]
[TD]Rehire Dt[/TD]
[TD]Termination[/TD]
[TD]Disciplinary[/TD]
[TD]Start Date[/TD]
[TD]End Date[/TD]
[TD]Days[/TD]
[TD]LOA[/TD]
[TD]Annual Rate[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1234[/TD]
[TD]EEA[/TD]
[TD]01574[/TD]
[TD]OTSA[/TD]
[TD]1021[/TD]
[TD][/TD]
[TD]10/22/16[/TD]
[TD]12/14/18[/TD]
[TD][/TD]
[TD][/TD]
[TD]12/14/18[/TD]
[TD]12/31/18[/TD]
[TD]18[/TD]
[TD]0[/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]$11,700.00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2345[/TD]
[TD]EEB[/TD]
[TD]01574[/TD]
[TD]OTSA[/TD]
[TD]1107[/TD]
[TD][/TD]
[TD]7/6/93[/TD]
[TD]2/5/18[/TD]
[TD]2/19/18[/TD]
[TD][/TD]
[TD]2/5/18[/TD]
[TD]2/19/18[/TD]
[TD]15[/TD]
[TD]0[/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]$11,700.00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]3456[/TD]
[TD]EEC[/TD]
[TD]01574[/TD]
[TD]OTSA[/TD]
[TD]1131[/TD]
[TD][/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]4/30/1979[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]5/22/2014[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD]01/01/2018[/TD]
[TD]3/31/18[/TD]
[TD]90[/TD]
[TD]0[/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]$11,502.40[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]3456[/TD]
[TD]EEC[/TD]
[TD]01574[/TD]
[TD]OTSA[/TD]
[TD]1131[/TD]
[TD][/TD]
[TD]4/30/1979[/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]5/22/2014[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD]4/1/2018[/TD]
[TD]12/31/18[/TD]
[TD]275[/TD]
[TD]0[/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]$11,762.40[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]4567[/TD]
[TD]EED[/TD]
[TD]01538[/TD]
[TD]SM[/TD]
[TD]4103[/TD]
[TD][/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]11/14/2005[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]01/01/2018[/TD]
[TD]09/16/18[/TD]
[TD]259[/TD]
[TD]0[/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]$36,358.40[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]4567[/TD]
[TD]EED[/TD]
[TD]01574[/TD]
[TD]OTSA[/TD]
[TD]4103[/TD]
[TD][/TD]
[TD]11/14/2005[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]9/17/18[/TD]
[TD]12/31/18[/TD]
[TD]106[/TD]
[TD]0[/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]$10,608.00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]5678[/TD]
[TD]EEE[/TD]
[TD]01574[/TD]
[TD]OTSA[/TD]
[TD]3023[/TD]
[TD][/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]4/17/1995[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]01/01/2018[/TD]
[TD]3/31/18[/TD]
[TD]90[/TD]
[TD]0[/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD]$26,228.80[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]5678[/TD]
[TD]EEE[/TD]
[TD]01574[/TD]
[TD]OTSA[/TD]
[TD]3023[/TD]
[TD][/TD]
[TD]4/17/1995[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]4/01/18[/TD]
[TD][TABLE="width: 103"]
<tbody>[TR]
[TD="class: xl66, width: 103"]12/31/2018[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]275[/TD]
[TD][/TD]
[TD]$29,120.00[/TD]
[/TR]
</tbody>[/TABLE]





Then I have another worksheet that consolidates rows and gives me the total number of days an employee worked the same position in the same store. In the example below, you can see that Rows 4&5 above are now one single row below, #4 as well as rows 8&9 above, are now row 7 below. Employee ID is a unique identifier.


[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[TD]K[/TD]
[TD]L[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Employee ID[/TD]
[TD]Name[/TD]
[TD]JobCode[/TD]
[TD]Jobtitle[/TD]
[TD]Store Number[/TD]
[TD]Secondary Store[/TD]
[TD]Hire Dt[/TD]
[TD]Rehire Dt[/TD]
[TD]Termination[/TD]
[TD]Disciplinary[/TD]
[TD]Days[/TD]
[TD]LOA[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1234[/TD]
[TD]EEA[/TD]
[TD]01574[/TD]
[TD]OTSA[/TD]
[TD]1021[/TD]
[TD][/TD]
[TD]10/22/16[/TD]
[TD]12/14/18[/TD]
[TD][/TD]
[TD][/TD]
[TD]18[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2345[/TD]
[TD]EEB[/TD]
[TD]01574[/TD]
[TD]OTSA[/TD]
[TD]1107[/TD]
[TD][/TD]
[TD]7/6/93[/TD]
[TD]2/5/18[/TD]
[TD]2/19/18[/TD]
[TD][/TD]
[TD]15[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]3456[/TD]
[TD]EEC[/TD]
[TD]01574[/TD]
[TD]OTSA[/TD]
[TD]1131[/TD]
[TD][/TD]
[TD]4/30/1979[/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]5/22/2014[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD]365[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]4567[/TD]
[TD]EED[/TD]
[TD]01538[/TD]
[TD]SM[/TD]
[TD]4103[/TD]
[TD][/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]11/14/2005[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]259[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]4567[/TD]
[TD]EED[/TD]
[TD]01574[/TD]
[TD]OTSA[/TD]
[TD]4103[/TD]
[TD][/TD]
[TD]11/14/2005[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]106[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]5678[/TD]
[TD]EEE[/TD]
[TD]01574[/TD]
[TD]OTSA[/TD]
[TD]3023[/TD]
[TD][/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]4/17/1995[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]365[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]
The formula I need is the largest annual rate to be inputted on my second worksheet where the employee ID, Job Code, and Store Number are the same as the source data.

EXAMPLE:

[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[TD]K[/TD]
[TD]L[/TD]
[TD]M[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Employee ID[/TD]
[TD]Name[/TD]
[TD]JobCode[/TD]
[TD]Jobtitle[/TD]
[TD]Store Number[/TD]
[TD]Secondary Store[/TD]
[TD]Hire Dt[/TD]
[TD]Rehire Dt[/TD]
[TD]Termination[/TD]
[TD]Disciplinary[/TD]
[TD]Days[/TD]
[TD]LOA[/TD]
[TD]Annual Rate[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1234[/TD]
[TD]EEA[/TD]
[TD]01574[/TD]
[TD]OTSA[/TD]
[TD]1021[/TD]
[TD][/TD]
[TD]10/22/16[/TD]
[TD]12/14/18[/TD]
[TD][/TD]
[TD][/TD]
[TD]18[/TD]
[TD][/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]$11,700.00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2345[/TD]
[TD]EEB[/TD]
[TD]01574[/TD]
[TD]OTSA[/TD]
[TD]1107[/TD]
[TD][/TD]
[TD]7/6/93[/TD]
[TD]2/5/18[/TD]
[TD]2/19/18[/TD]
[TD][/TD]
[TD]15[/TD]
[TD][/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]$11,700.00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]3456[/TD]
[TD]EEC[/TD]
[TD]01574[/TD]
[TD]OTSA[/TD]
[TD]1131[/TD]
[TD][/TD]
[TD]4/30/1979[/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]5/22/2014[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD]365[/TD]
[TD][/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]$11,762.40[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]4567[/TD]
[TD]EED[/TD]
[TD]01538[/TD]
[TD]SM[/TD]
[TD]4103[/TD]
[TD][/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]11/14/2005[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]259[/TD]
[TD][/TD]
[TD]$36,358.40[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]4567[/TD]
[TD]EED[/TD]
[TD]01574[/TD]
[TD]OTSA[/TD]
[TD]4103[/TD]
[TD][/TD]
[TD]11/14/2005[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]106[/TD]
[TD][/TD]
[TD]$10,608.00[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]5678[/TD]
[TD]EEE[/TD]
[TD]01574[/TD]
[TD]OTSA[/TD]
[TD]3023[/TD]
[TD][/TD]
[TD][TABLE="width: 69"]
<tbody>[TR]
[TD="class: xl66, width: 69"]4/17/1995[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]365[/TD]
[TD][/TD]
[TD]$29,120.00[/TD]
[/TR]
</tbody>[/TABLE]









I know it is a combination of IF and VLOOKUP's but I have zero room for error and my actual data is 5000+ Rows.

Thank you in advance for your help.

Sincerely,

Me.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Forum statistics

Threads
1,224,752
Messages
6,180,743
Members
452,996
Latest member
nelsonsix66

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