IF Statement with Greater Than value

Orezsce

New Member
Joined
Aug 8, 2018
Messages
1
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

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
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.
 
Upvote 0
Its working, which result you want??




Book1
KLM
6DO10
7BH28
8AL38
94524
Sheet4
Cell Formulas
RangeFormula
M6=IF(K6="DO",0,IF(K6="BH",8,IF(K6="AL",8,IF(L6-K6>6,-1,(L6-K6)*24))))
M7=IF(K7="DO",0,IF(K7="BH",8,IF(K7="AL",8,IF(L7-K7>6,-1,(L7-K7)*24))))
M8=IF(K8="DO",0,IF(K8="BH",8,IF(K8="AL",8,IF(L8-K8>6,-1,(L8-K8)*24))))
M9=IF(K9="DO",0,IF(K9="BH",8,IF(K9="AL",8,IF(L9-K9>6,-1,(L9-K9)*24))))
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,244
Members
452,622
Latest member
Laura_PinksBTHFT

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