1. Registered User
Join Date
Mar 2004
Location
California
Posts
502

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. Purveyor of Discontent
Join Date
Mar 2003
Location
The Bottom of The Barrel
Posts
6,102
Remember the mathematical order of operations...

The way the parenthesis are put together in Excel should point you in the right direction.

3. Registered User
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.

Rick

4. Purveyor of Discontent
Join Date
Mar 2003
Location
The Bottom of The Barrel
Posts
6,102
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...

5. Registered User
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
•