Convert a Excel formula to Access expression

Dana5535

New Member
Joined
Mar 30, 2015
Messages
12
I have an excel spreadsheet formula that calculates the percentage of time that has elapsed for a contract.

The excel formula is =(Today()-A38)/(B38-A38) . A32 represents the starting date of the contract and B38 represents the ending date of the contract.

Is there a way to convert this formula to an expression in Access?

I am still learning Access 2010, so any help will be appreciated.

Thanks,
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Welcome to the Board!

Just use DATE() instead of TODAY(), and your field names in place of your cell references.
The structure should be exactly the same.
 
Upvote 0
Welcome to the Board!

Just use DATE() instead of TODAY(), and your field names in place of your cell references.
The structure should be exactly the same.

Thanks for the info. I tried that and didn't get what I expected. When I use the excel formula using this formula: =(TODAY()-A48)/(B48-A48) Today is today's date, A48 =2/2/15 and B48 = 2/3/17 the result is 7.79%. However when I use this express in access (Date())-[Validfrom]/[Validto]-[Validfrom], Validfrom = 2/2/15 and Validto = 2/3/17, I get this result: 56.0171152002586

I thought it should work that way also, but now I'm confused.

Thanks.
 
Upvote 0
It appears to be an mathematical "order of operations" issue. Parentheses are very important, don't drop them (or move them around), if you want the formula to work the same way.

The equivalent of:
Code:
[COLOR=#333333]=(TODAY()-A48)/(B48-A48)[/COLOR]
would be:
Code:
[COLOR=#333333](Date()-[Validfrom])/([Validto]-[Validfrom])[/COLOR]
 
Upvote 0
Joe, this looks like it will work, so simple. I just missed it. Thank you for the help, extremely grateful!
 
Upvote 0
Excellent! Glad to help!:)
 
Upvote 0

Forum statistics

Threads
1,221,893
Messages
6,162,662
Members
451,781
Latest member
DylantheD

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