Calc: use + / - statement for calculation

Asked by karlrt

I have this table, representing currency values like - 7,74 or + 5,24 for accounting:

-7 48
12 10
-0 76
....

I want to recalculate them, but the but how can I get the second row to use the "-" value if its a negative booking?

Currently i use: =A2+B2/100 which works only for positive statements, for negative statements i need to use A1-B1/100

thanks for your help!

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu openoffice.org Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
mycae (mycae) said :
#1

try

=IF(A1<0; A1-B1;A1+B1)

Revision history for this message
mycae (mycae) said :
#2

Oops.

I think they use comma's now -- though the separator may depend upon your locale.

=IF(A1<0,A1-B1,A1+B1)

Revision history for this message
karlrt (karlrt) said :
#3

didnt think of an easy if statement, thanks for this simple solution, but somehow it doesnt work as expected:

with ; as seperator, it gives #NAME?
with , it just states Err:501

dont know what is wrong, just to get it right i even tried an easy example: http://www.openofficeschool.org/calc/if/ which didnt give the expected results, just the #NAME? again :(

Revision history for this message
mycae (mycae) said :
#4

make sure that your values are actually entered in as numerical data, rather than text

For example, I opened a new file, typed in 123 in A1, -123 in A2, then put the following formula in C1
=IF(A1<0,A1+A2,A1-A2)

This gives the expected answer of 246.

Revision history for this message
marcus aurelius (adbiz) said :
#5

Format > Cells > Numbers then accounting

want to learn how to use openoffice? the manuals are here

http://wiki.services.openoffice.org/wiki/Documentation/OOo3_User_Guides

Can you help with this problem?

Provide an answer of your own, or ask karlrt for more information if necessary.

To post a message you must log in.