# Multiple IF Search

#### Spockster

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

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
=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:

Replies
1
Views
373
Replies
4
Views
552
Replies
16
Views
608
Replies
3
Views
169
Replies
1
Views
429

1,221,153
Messages
6,158,223
Members
451,477
Latest member
CWebbers

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