Rounding Up To Even number

G

Guest

This is the best one yet. I have a Fee for services on my report. It works
perfectly from my point of view. It rounds the calculated fee from $545.52 to
$546.

My boss says he wants it to round up to the nearest "even" dollar amount,
since they bill in two equal installments. I suggested charging 50 cents, but
they want to keep it to dollars.

Here is the formula now: =Sum([Proj_save])*([Mgmt_fee])

Can someone help me with how to make it round up to 0,2,4,6,8?

In Excel it is =EVEN(1.5) rounds 1.5 to the nearest even integer 2; =EVEN(3)
rounds 3 up to the nearest even integer 4; =EVEN(2) rounds 2 up to the
nearest even integer 2; and =EVEN(-1) rounds -1 up to the nearest even
integer (-2).
 
M

Marshall Barton

Novice2000 said:
This is the best one yet. I have a Fee for services on my report. It works
perfectly from my point of view. It rounds the calculated fee from $545.52 to
$546.

My boss says he wants it to round up to the nearest "even" dollar amount,
since they bill in two equal installments. I suggested charging 50 cents, but
they want to keep it to dollars.

Here is the formula now: =Sum([Proj_save])*([Mgmt_fee])

Can someone help me with how to make it round up to 0,2,4,6,8?

In Excel it is =EVEN(1.5) rounds 1.5 to the nearest even integer 2; =EVEN(3)
rounds 3 up to the nearest even integer 4; =EVEN(2) rounds 2 up to the
nearest even integer 2; and =EVEN(-1) rounds -1 up to the nearest even
integer (-2).


Access doesn't have an Even function so you'll have to
create your own:

Public Function MyEven(x As Variant) As Variant
If (IsNull(x) Or Int(x/2) = x/2) Then
MyEven = x
Else
MyEven = Fix((X+2)/2)*2
End If
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top