Multiple IF Search

Spockster

Board Regular
Joined
Jun 9, 2002
Messages
108
I am trying to define a number between several numbers as shown

=IF((C5>12),75,IF((C5>8),60,IF((C5>7),45,IF((C5.6),30,IF((C5>4),15,"0")))))

This basically says that if someone works 12 hours they get 75min of breaks if they work 8 hours or more but not 12 or more they get 60.

the formula is not working for me though. Any ideas?

Thank you again for whoever helps
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
=IF((C5>12),75,IF((C5>8),60,IF((C5>7),45,IF((C5.6),30,IF((C5>4),15,"0")))))

You have a decimal for the 6 hour check?

Maybe you want:

=IF((C5>12),75,IF((C5>8),60,IF((C5>7),45,IF((C5>6),30,IF((C5>4),15,"0")))))

That is just looking at a quick glance. And not sure why you want to return a text 0?

This could also be done many other ways, like:

=CHOOSE(C5,"0","0","0","0",15,15,30,45,60,60,60,60,75)

Or:

=LOOKUP(C5,{0,4.01,6.01,7.01,8.01,12.01},{"0",15,30,45,60,75})

The decimals depend if you are looking at > or >= which I think you may want >= because the formula you have, if they work 12 hours they will only get 60 minutes. Let me know and I can adjust the formulas given.

Hope that helps.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,821
Members
449,049
Latest member
cybersurfer5000

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