# IF Statement with Greater Than value

#### Orezsce

##### New Member
Hi All

I have a rota on Excel that originally referenced a specific cell to determine whether or not to include a lunch break in the total hours cell. I would prefer to simply add this into the IF statement and eradicate the unnecessary extra cell where a lunch break is manually selected.

Currently, I have this, but it does not correctly deduct the hour:
Rich (BB code):
``=IF(K6=ʺDOʺ,0,IF(K6=ʺBHʺ,8,IF(K6=ʺALʺ,8,IF(L6-K6>6,-1,(L6-K6)*24))))``

I can't reference the total cell (N6) without creating a circular reference, which was my only other thought.

Any ideas?

### Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

#### jorismoerings

##### Well-known Member
Hi,

Your formula will never reach the calculation at the end if K6 hold one of the criteria you've mentioned beside K6 holds criteria so basically the calculation part says =L6-"AL">1

Just show soem sample data and explain more indepth what you expect.

##### Active Member
Its working, which result you want??

Replies
8
Views
375
Replies
10
Views
395
Replies
1
Views
68
Replies
1
Views
64
Replies
6
Views
439

1,136,322
Messages
5,675,075
Members
419,549
Latest member
EliteBeat

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