ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Calculation Problem (https://www.excelbanter.com/excel-programming/341339-calculation-problem.html)

Tempy

Calculation Problem
 
Good day all, i have a calculation below which calculates the following,
Cells G - H x E = result should be "0"

G = 2185.79
H = 2185.79
E = 4

However i get a result of -6557.37 ??

ActiveCell.FormulaR1C1 = "=RC[-2]-RC[-1]*RC[-4]"

Could somebody please give me some help with this.

thanks in advance.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***

Roger Govier[_10_]

Calculation Problem
 
Hi Tempy

Multiplication takes precedence over subtraction.
You are taking 4 x 2185.79 away from 2185.79.

Change to

ActiveCell.FormulaR1C1 = "=(RC[-2]-RC[-1])*RC[-4]"

Regards

Roger Govier


Tempy wrote:
Good day all, i have a calculation below which calculates the following,
Cells G - H x E = result should be "0"

G = 2185.79
H = 2185.79
E = 4

However i get a result of -6557.37 ??

ActiveCell.FormulaR1C1 = "=RC[-2]-RC[-1]*RC[-4]"

Could somebody please give me some help with this.

thanks in advance.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***


Tempy

Calculation Problem
 
Thanks Roger

Tempy

*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 07:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com