# CF - From 2 cells in row

#### ExcelRoy

##### Well-known Member
Hi,

I am looking to highlight 2 points in a row between cells entered as "In" and "Out"

What would be the best way to achieve this, assume CF ?

Range is within columns K:NH

### Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

#### DanteAmor

##### Well-known Member
Try this formula:
=OR(K1="In",K1="Out")

Applies to:
=\$K:\$NH

#### ExcelRoy

##### Well-known Member
Hi DanteAmor,

Many thanks but this only highlights those points (ie "In" and "Out"and not inbetween

Thanks

#### Joe4

Try the following.
Select columns K:NH on your sheet, and enter this Conditional Formatting formula:
Excel Formula:
``=AND(COUNTIF(\$K1:K1,"In")>0,COUNTIF(K1:\$NH1,"Out")>0)``
and select your desired formatting color.

#### DanteAmor

##### Well-known Member

Try this:

Excel Formula:
``=AND(COLUMN()>=MATCH("in",1:1,0),COLUMN()<=MATCH("out",1:1,0))``

Last edited:

#### ExcelRoy

##### Well-known Member
Thankyou Both, perfect solutions

One step on from this, would it be possible to highlight cells based on time remaining

At the moment each cell denotes a calendar day (Weekday only)

ie, a job would be given 74 hours to complete and 20 has been used leaving 50 remaining could this be highlighted using CF

The hours left would be as follows totaling 32 hours

Mon 7 hours
Tues 7 hours
Wed 7 hours
Thu 7 hours
Fri 4 hours

So from the point of "In" to calculate a automatic "Out" date based on a cell value of total hours worked against total hours remaining

Many thanks

#### Joe4

ie, a job would be given 74 hours to complete and 20 has been used leaving 50 remaining could this be highlighted using CF

The hours left would be as follows totaling 32 hours

Mon 7 hours
Tues 7 hours
Wed 7 hours
Thu 7 hours
Fri 4 hours

So from the point of "In" to calculate a automatic "Out" date based on a cell value of total hours worked against total hours remaining
That is an entirely different question from your original question, and thus probably warrants its own thread.

Replies
4
Views
62
Replies
3
Views
85
Replies
2
Views
89
Replies
1
Views
41
Replies
1
Views
116

1,126,986
Messages
5,621,995
Members
415,873
Latest member
fuulhouse

### 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.

### Which adblocker are you using?

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

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