1

I'm trying to format a spreadsheet containing timesheet data to flag certain conditions.

Each row of data represents a single pair of clock-in and clock-out times for an employee.

There can be several rows for a single employee representing each time they switched jobs, took a break, etc.

The columns are as follows:

A B C D E F G H I
First Name Last Name Date Day Start Time End Time Hours Job Notes

I need a conditional formatting rule to highlight any row that does not have the word 'Done' in Column I Notes if the following conditions are also met:

  1. Column H Job contains the word 'shop' or 'warehouse' anywhere in the cell contents.
  2. There is at least one other row that has matching values for all of the following columns:
    1.   Column A   First Name
    2.   Column B   Last Name
    3.   Column C   Date
    4.   Column H   Job

I started with the following formula for the same First Name, Last Name and Job, but I can't figure out how to build on it for the text matches in Job and Notes:

=COUNTIF(ARRAYFORMULA($A$2:$A$983& $B$2:$B$983& $C$2:$C$983& $H$2:$H$983), $A2&$B2& $C2& $H2)>1 
0

1 Answer 1

0

Conditional Format Custom Formula

=NOT(REGEXMATCH($I2, "(?i)done")) * REGEXMATCH(""& $H2, "(?i)shop|warehouse") * COUNTIFS($A$2:$A,$A2, $B$2:$B, $B2, $C$2:$C,$C2,$H$2:$H,$H2)>1 

COUNTIFS  NOT  REGEXMATCH

Variation 1

If Column I Notes will only contain 'Done' by itself the first REGEXMATCH can be dropped:

=($I2 <> "done") * REGEXMATCH(""& $H2, "(?i)shop|warehouse") * COUNTIFS($A$2:$A,$A2, $B$2:$B, $B2, $C$2:$C,$C2,$H$2:$H,$H2)>1 

Variation 2

If you are confident the text strings targeted by the REGEXMATCH functions are always capitalized properly then (?i) can be omitted from the regular expressions:

=NOT(REGEXMATCH($I2, "Done")) * REGEXMATCH(""& $H2, "Shop|Warehouse") * COUNTIFS($A$2:$A,$A2, $B$2:$B, $B2, $C$2:$C,$C2,$H$2:$H,$H2)>1 

    or, if based on Variation 1:

=($I2 <> "done") * REGEXMATCH(""& $H2, "Shop|Warehouse") * COUNTIFS($A$2:$A,$A2, $B$2:$B, $B2, $C$2:$C,$C2,$H$2:$H,$H2)>1 
1

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.