COUNTIF conditional formatting meeting two conditions (Excel 2003)

bunny3

New Member
Joined
Mar 13, 2015
Messages
4
I am trying to use conditional formatting in Excel 2003 to highlight the first instance of a certain value in column C where the corresponding cell in A is also a different, specific value.

Currently, I am using =COUNTIF($C$2:$C3,$C3)=1 in row 3 (and so on for the other rows) to highlight the first time a client's name appears.

BCDFG
1Work DateClientStaffStart TimeEnd Time
21/5ThompsonAnthony12:45 PM1:45 PM
31/5ThompsonTim12:45 PM1:45 PM
41/5SmithTim9:00 AM10:00 AM
51/5SmithTim10:30 AM11:30 AM
62/5ThompsonMark10:30 AM12:00 PM
72/5SmithTim9:00 AM12:00 PM

<tbody>
</tbody>

[Columns A and E omitted deliberately.]

The current formula highlights rows 2 and 4: the first time "Thompson" appears in column C is cell C2 and the first time "Smith" appears in column C is cell C4.

Now I would like to change the formula so that it highlights the first instance of the client's name for each work day (column B). The result should be that rows 2, 4, 5, 6, and 7 are highlighted.

I tried =AND(COUNTIF($B$2:$B3,$B3)=1,COUNTIF($C$2:$C3,$C3)=1), but that doesn't highlight row 7, because the date 2/5 has already appeared in row 6.

Can you come up with a formula that can achieve what I want? Please keep in mind I'm using Excel 2003.

I hope my question is clear. Thank you for your help.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Did you mean 2, 3, 4, 6, & 7? 5 would be a later time for Tim Smith on the same date.
 
Upvote 0
I put the staff name and client name together, not paying attention. I'm guessing it was supposed to be 2, 4, 6, & 7 highlighted.
 
Upvote 0
Can you do a helper column? My answer is an array formula, which you can't put directly in as a conditional format. In the first cell of the helper column, =IF(SUM(($B$2:B2&$C$2:C2=B2&C2)*1)=1,1,"") ,array entered (Ctrl+Shift+Enter), and copy down. Then your conditional format would be based on the helper column showing a 1.
 
Upvote 0
Can you do a helper column? My answer is an array formula, which you can't put directly in as a conditional format. In the first cell of the helper column, =IF(SUM(($B$2:B2&$C$2:C2=B2&C2)*1)=1,1,"") ,array entered (Ctrl+Shift+Enter), and copy down. Then your conditional format would be based on the helper column showing a 1.

Thank you, C Moore. I added a helper column, as you suggested, and the array formula you gave works great.
 
Upvote 0

Forum statistics

Threads
1,214,592
Messages
6,120,433
Members
448,961
Latest member
nzskater

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