Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Location
    California
    Posts
    502

    Unanswered: Calculation For Percent

    I have this calculation in a report detail section where the two fields reside formated as percent.

    =[Prev Yr median close price]-[Curr Yr median close price]/[Curr Yr median close price]

    It should produce ##.##%

    Ain't happn!

    It is producing ########.##%

    This is the excel function that does work in Excel:
    "=IF(AND(B38<>0,ISNUMBER(E38)),(E38-B38)/B38,0)"

    Any ideas?

    Thanks . . . Rick

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Remember the mathematical order of operations...

    The way the parenthesis are put together in Excel should point you in the right direction.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Mar 2004
    Location
    California
    Posts
    502

    Uh !

    OK . . .

    =([Prev Yr median close price])-([Curr Yr median close price])/([Curr Yr median close price])

    Teddy . . . this didn't make any difference. It'a based on a query.

    Give me another hint please.

    Rick

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    It wouldn't.

    Division takes precedence over subtraction. You must use the parenthesis to force the subtraction to occur first.

    Your excel formula is accomplishing this goal like so:

    (E38-B38)/B38


    Swap out the cell references with your field names...
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  5. #5
    Join Date
    Mar 2004
    Location
    California
    Posts
    502

    I Got it!

    This works:

    =([Curr Yr median close price]-[Prev Yr median close price])/[Prev Yr median close price]


    Thanks Teddy


    Rick

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •