Highlight rows based on multiple cell values by date

nitaly

New Member
Joined
Sep 23, 2015
Messages
22
For each row where the labor category and employee name is the same I need the earliest invoice date. For example I need to know the earliest date Jack Doe invoiced as Executive Accountant I by having that row highlighted. The the earliest date Jack Doe invoiced as a Acct Executive by highlighting that row. I have a thousands of line items to deal with so figuring this out will save a lot of time.

Invoice DateLabor CategoryEmployee Name
11/20/2012Executive Accountant IDoe, Jack
12/20/2012Executive Accountant IDoe, Jack
2/26/2014Acct. ExecutiveDoe, Jack
2/26/2014Acct. ExecutiveDoe, Jack
4/22/2014Acct. ExecutiveDoe, Jack
8/22/2013Executive Accountant IIDoe, Jack
9/24/2013Executive Accountant IIDoe, Jack
10/24/2013Executive Accountant IIDoe, Jack
4/30/2014Account Executive IIDoe, Jack
6/24/2014Account Executive IIDoe, Jack
10/27/2014Account Executive IIDoe, Jack
10/6/2014Senior ExecutiveDoe, Jack
10/8/2014Senior ExecutiveDoe, Jack
12/1/2014Executive Accountant IIDoe, Jack
3/28/2016Senior ExecutiveDoe, Jack
4/21/2016Senior ExecutiveDoe, Jack
5/31/2016Senior ExecutiveDoe, Jack
2/24/2015Sr. Acct. SupervisorSmith, Jane
2/10/2015Account SupervisorSmith, Jane
2/24/2015Account SupervisorSmith, Jane
3/25/2015Account SupervisorSmith, Jane

<colgroup><col><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Rather than highlighting, why not just extract the earliest date for any combination of Labor Category and Employee Name? Copy G2 down and adjust the ranges to match your database>
Excel Workbook
ABCDEFG
1Invoice DateLabor CategoryEmployee Name*Labor CategoryEmployee NameEarliest Date
211/20/2012Executive Accountant IDoe, Jack*Executive Accountant IDoe, Jack11/20/2012
312/20/2012Executive Accountant IDoe, Jack*Acct. ExecutiveDoe, Jack2/26/2014
42/26/2014Acct. ExecutiveDoe, Jack*Senior ExecutiveDoe, Jack10/6/2014
52/26/2014Acct. ExecutiveDoe, Jack*Account SupervisorSmith, Jane2/10/2015
64/22/2014Acct. ExecutiveDoe, Jack****
78/22/2013Executive Accountant IIDoe, Jack****
89/24/2013Executive Accountant IIDoe, Jack****
910/24/2013Executive Accountant IIDoe, Jack****
104/30/2014Account Executive IIDoe, Jack****
116/24/2014Account Executive IIDoe, Jack****
1210/27/2014Account Executive IIDoe, Jack****
1310/6/2014Senior ExecutiveDoe, Jack****
1410/8/2014Senior ExecutiveDoe, Jack****
1512/1/2014Executive Accountant IIDoe, Jack****
163/28/2016Senior ExecutiveDoe, Jack****
174/21/2016Senior ExecutiveDoe, Jack****
185/31/2016Senior ExecutiveDoe, Jack****
192/24/2015Sr. Acct. SupervisorSmith, Jane****
202/10/2015Account SupervisorSmith, Jane****
212/24/2015Account SupervisorSmith, Jane****
223/25/2015Account SupervisorSmith, Jane****
Sheet2
 
Upvote 0
Thanks for the help Joe. I entered and executed the array but I'm only getting a 0 for an answer on all cells. Any suggestions?
 
Upvote 0
Thanks for the help Joe. I entered and executed the array but I'm only getting a 0 for an answer on all cells. Any suggestions?
Enter the formula in G2, then confirm it by holding down the shift and ctrl keys and pressing Enter. Then simply copy G2 down. Be sure all the cols A, B and C ranges are absolute.
 
Upvote 0
I held down the Shift+Ctrl then Enter and copied the formula down. I know it worked because the {} appeared afterward. Here is the formula I used.. =MIN(IF(($B$2:$B$6848=E2)*($C$2:$C$6848=F2),$A$2:$A$6848))
 
Upvote 0
I held down the Shift+Ctrl then Enter and copied the formula down. I know it worked because the {} appeared afterward. Here is the formula I used.. =MIN(IF(($B$2:$B$6848=E2)*($C$2:$C$6848=F2),$A$2:$A$6848))
Can you confirm that col A holds the invoice dates, col B the Labor Category, col C the Employee Name? Also confirm that col E holds the specific Labor Category of interest, and col F the specific employee name of interest.

EDIT: If there is no match in your database to the specific labor category and employee name (cols E & F) the formula will return 0 (1/1/1900 if cell is formatted as date). The matches MUST be EXACT and the Invoice dates must be Excel serial dates NOT TEXT dates.
 
Last edited:
Upvote 0
I think I figured out the issue but wanted to run it by you. I copied column's B and C to E and F and then the array formula in G. The only issue I see is I get a value for every line as you can see below. I can just remove duplicates to fix that if everything else is correct. Is there any issues with what I described?

ABCEFG
Invoice DateLabor CategoryEmployee NameLabor CategoryEmployee NameInvoice Date
11/20/2012Executive Accountant IDoe, JackExecutive Accountant IDoe, Jack11/20/2012
12/20/2012Executive Accountant IDoe, JackExecutive Accountant IDoe, Jack11/20/2012
2/26/2014Acct. ExecutiveDoe, JackAcct. ExecutiveDoe, Jack2/26/2014
2/26/2014Acct. ExecutiveDoe, JackAcct. ExecutiveDoe, Jack2/26/2014
4/22/2014Acct. ExecutiveDoe, JackAcct. ExecutiveDoe, Jack2/26/2014
8/22/2013Executive Accountant IIDoe, JackExecutive Accountant IIDoe, Jack8/22/2013
9/24/2013Executive Accountant IIDoe, JackExecutive Accountant IIDoe, Jack8/22/2013
10/24/2013Executive Accountant IIDoe, JackExecutive Accountant IIDoe, Jack8/22/2013
4/30/2014Account Executive IIDoe, JackAccount Executive IIDoe, Jack4/30/2014
6/24/2014Account Executive IIDoe, JackAccount Executive IIDoe, Jack4/30/2014
10/27/2014Account Executive IIDoe, JackAccount Executive IIDoe, Jack4/30/2014
10/6/2014Senior ExecutiveDoe, JackSenior ExecutiveDoe, Jack10/6/2014
10/8/2014Senior ExecutiveDoe, JackSenior ExecutiveDoe, Jack10/6/2014
12/1/2014Executive Accountant IIDoe, JackExecutive Accountant IIDoe, Jack8/22/2013
3/28/2016Senior ExecutiveDoe, JackSenior ExecutiveDoe, Jack10/6/2014
4/21/2016Senior ExecutiveDoe, JackSenior ExecutiveDoe, Jack10/6/2014
5/31/2016Senior ExecutiveDoe, JackSenior ExecutiveDoe, Jack10/6/2014
2/24/2015Sr. Acct. SupervisorSmith, JaneSr. Acct. SupervisorSmith, Jane2/24/2015
2/10/2015Account SupervisorSmith, JaneAccount SupervisorSmith, Jane2/10/2015
2/24/2015Account SupervisorSmith, JaneAccount SupervisorSmith, Jane2/10/2015
3/25/2015Account SupervisorSmith, JaneAccount SupervisorSmith, Jane2/10/2015

<colgroup><col><col><col><col><col><col span="2"></colgroup><tbody>
</tbody>
 
Upvote 0
Remove duplicates from E & F, then put the formula in G and copy it down.
 
Upvote 0
Just say I have corresponding data, like Contract Number & Hourly Rate, that I want to bring over with the associated earliest invoice date.


ABCDE
Invoice DateLabor CategoryEmployee NameContract NumberHourly Rate
11/20/2012Executive Accountant IDoe, Jack1125.00
12/20/2012Executive Accountant IDoe, Jack1123.00
2/26/2014Acct. ExecutiveDoe, Jack2230.00
2/26/2014Acct. ExecutiveDoe, Jack2229.00
4/22/2014Acct. ExecutiveDoe, Jack2230.00
8/22/2013Executive Accountant IIDoe, Jack5681.00
9/24/2013Executive Accountant IIDoe, Jack5685.00
10/24/2013Executive Accountant IIDoe, Jack5685.00
4/30/2014Account Executive IIDoe, Jack8441.00
6/24/2014Account Executive IIDoe, Jack6644.00
10/27/2014Account Executive IIDoe, Jack8744.00
10/6/2014Senior ExecutiveDoe, Jack9622.00
10/8/2014Senior ExecutiveDoe, Jack2223.00

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,395
Members
449,081
Latest member
JAMES KECULAH

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