# Thread: basic mathematics in report generator

1. affoltep Gast

## basic mathematics in report generator

Hello

I wonder about the syntax and possibilities in report generator.
If I get for example two values by "=variabler(....)" in cell A1 and A2.
In A3 I can add them without any error with the command "=A1+A2".
But I can not sub them with "=A1-A2", I always get an error "#BADOP!)

What is the meaning of all the "#...." messages. I couldn't find anything in the help
What is the correct syntax for variables for basic mathematical functions as "+", "-", "*" and "/". I couldn't find anything in help neither.

2. ## Re: basic mathematics in report generator

pleae try using parenthesis:

=(A1-A2)

this should work.

3. ## Re: basic mathematics in report generator

Did you get this error also in the Runtime?

The report can add numbers and characters but only sub numbers.

Ok lets play a little bit:
cell value/function
A1 5
B1 2
C1 =A1+B1
D1 =A1-B1
editor C1 -> 7; D1 -> 3
runtime C1 -> 7; D1 -> 3
Cells with numbers are workung with add and sub

Same with strings
cell value/function
A1 abc
B1 def
C1 =A1+B1
D1 =A1-B1
editor C1 -> abcdef; D1 -> #BADOP!
runtime C1 -> abcdef; D1 -> #BADOP!
Cells with strings, only add is working

Same with functions
aktual value of variable variblename1=5
aktual value of variable variblename2=2
cell value/function
A1 =variabler("variblename1","value") displayed as - (minus)
B1 =variabler("variblename2","value") displayed as - (minus)
C1 =A1+B1
D1 =A1-B1
editor C1 -> --; D1 -> #BADOP!
runtime C1 -> 7; D1 -> 2

Editor: the report interprets the functions as strings.
Runtime: the report replace the function with values.

4. affoltep Gast

## AW: basic mathematics in report generator

Yes, it is just in editor - I always thought #BADOP! means that it doesn't work in rt, too.