# Formula Help... IF with rounding to nearest quarter

#### bobletcs123

##### New Member
Hi All,

Have a sheet with labor hours. Previously, anything that was <1 would get rounded up to 1 and anything over would be actual number...
Then, we changed to just go with actual numbers all around. Easy enough, just change formula to have labor hours field times whatever the rate is (A2*78).

Now, we want to see about not rounding up to 1, but to the nearest quarter...
0.01-0.25 = 0.25 ; 0.26-0.50 = 0.50 ; 0.51-0.75 = 0.75 ; 0.75-1.00 = 1.00

So, getting error too many arguments. Must be missing another AND or OR? Basically, anything that says "Remote Diagnostics" has a \$25 rate and everything else has \$78 rate.
I think the main formula is good, but not when I add in the "Remote Diagnostic" secction.
Main: = IF(AND(J3>=0,J3<=0.25),0.25*78,IF(AND(J3>0.25,J3<=0.5),0.5*78,IF(AND(J3>0.5,J3<=0.75),0.75*78,IF(AND(J3>0.75,J3<=1),1*78,J3*78)))))

### Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

#### Eric W

##### MrExcel MVP

=ROUNDUP(J3*4,0)/4*IF(G3="Remote Diagnostics",25,78)

This doesn't take into account if J3 > 1.

#### Tetra201

##### MrExcel MVP
Maybe
Excel Formula:
``=IF(J3<1,CEILING(J3,0.25),J3)*IF(G3="Remote Diagnostics",25,78)``

#### Eric W

##### MrExcel MVP
I always forget about CEILING . . .

#### bobletcs123

##### New Member

I don't even know of the CEILING lol

#### bobletcs123

##### New Member
Maybe
Excel Formula:
``=IF(J3<1,CEILING(J3,0.25),J3)*IF(G3="Remote Diagnostics",25,78)``
Thank you so much! works like a charm. I always tend to make the formulas too complex.

#### bobletcs123

##### New Member

=ROUNDUP(J3*4,0)/4*IF(G3="Remote Diagnostics",25,78)

This doesn't take into account if J3 > 1.
Thank you !

#### bobletcs123

##### New Member
Crap!!! It doesn't round up any zero fields.... Any idea how to add that into it as well?

#### bobletcs123

##### New Member
Maybe
Excel Formula:
``=IF(J3<1,CEILING(J3,0.25),J3)*IF(G3="Remote Diagnostics",25,78)``
Crap!!! It doesn't round up any zero fields.... Any idea how to add that into it as well?

#### jtakw

##### Well-known Member
Hi,

Why would 0 (zero) get rounded up?
Doesn't 0 indicate No Labor Hours or Work performed?

Replies
5
Views
95
Replies
0
Views
73
Replies
9
Views
574
Replies
5
Views
287
Replies
7
Views
406

1,132,973
Messages
5,656,179
Members
418,287
Latest member
reba557

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