Excel Formula as a Access Expression

tbowland

New Member
Joined
Jul 13, 2017
Messages
3
Most of the formula functions I have used in this Excel doc. are not available as a Access expression.

So to achieve what I have here > Retail rounding up to specific numbers (as well as calculating the retail)
I have to start over in access
Can anyone help or maybe I have to go to a access forum.

Thanks in advance
Ted
=INT(([@[Cost / Unit]]/(1-[@[Set Desired MG%]])))+INDEX($A$11:$A$19,MATCH(ROUND(([@[Cost / Unit]]/(1-[@[Set Desired MG%]]))-INT(([@[Cost / Unit]]/(1-[@[Set Desired MG%]]))),15),$A$11:$A$19,-1))
ROUNDING NUMBERSCost / UnitSet Desired MG%No RoundingRetail (rounded)
$1.15$1.9638%$3.16$3.25
$0.95$1.9438%$3.13$3.15
$0.85$1.9038%$3.06$3.15
$0.75$1.8638%$3.00$3.15
$0.65$1.8438%$2.97$3.15
$0.50$1.7638%$2.84$2.85
$0.35$1.7438%$2.81$2.85
$0.25$1.5838%$2.55$2.65
$0.15$1.4838%$2.39$2.50
$1.6238%$2.61$2.65
$1.6438%$2.65$2.65
$1.6638%$2.68$2.75
$1.2238%$1.97$2.15
$1.2438%$2.00$2.15
$1.2638%$2.03$2.15
$1.3038%$2.10$2.15
$1.0538%$1.69$1.75
$1.0638%$1.71$1.75
$1.0738%$1.73$1.75
$1.0838%$1.74$1.75
$1.0938%$1.76$1.85
$1.1038%$1.77$1.85
$1.1138%$1.79$1.85
$1.1238%$1.81$1.85
$1.1338%$1.82$1.85

<tbody>
</tbody>
<strike></strike>

<tbody>
</tbody>
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
As with Excel there is a few ways to do this in access...

I would probably build a function (example below) in a module and call that from the query:



Code:
Function RetailAmt(Amt As Double) As Double
Dim roundamount As Double
RetailAmt = Fix(Amt)
roundamount = Amt - RetailAmt
Select Case roundamount
    Case Is > 0.95
    RetailAmt = RetailAmt + 1.15
    Case Is > 0.85
    RetailAmt = RetailAmt + 0.95
    Case Is > 0.75
    RetailAmt = RetailAmt + 0.85
    Case Is > 0.65
    RetailAmt = RetailAmt + 0.75
    Case Is > 0.5
    RetailAmt = RetailAmt + 0.65
    Case Is > 0.35
    RetailAmt = RetailAmt + 0.5
    Case Is > 0.25
    RetailAmt = RetailAmt + 0.35
    Case Is > 0.15
    RetailAmt = RetailAmt + 0.25
    Case Is > 0
    RetailAmt = RetailAmt + 0.15
End Select
End Function
 
Last edited:
Upvote 0

Forum statistics

Threads
1,217,363
Messages
6,136,108
Members
449,993
Latest member
Sphere2215

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