Ask Your Question

# If function?

Hi there my sisters and brothers,

I am recovering from brain damage caused by pharmaceutical drugs and having trouble with logic and memory processes.

I am secretary for a group, and am setting up documents in Open Source software so that whoever follows will be able to use the same applications the docs were created in, with no financial outlay. Because most of us are elderly and pensioners this is essential.

I am using LibreOffice 6.10.3 on Manjaro Linux if that is of any use. I also have been using Scribus, Inkscape and Gimp and love them all.

I intend to use data merge to create emails with included membership balances (and other data) pulled from Calc.

What I need to do is have Calc add strings in a cell for two conditions, and nothing for the third as follows:

1. have "Credit" added if the balance>0
2. have "Debit" added if the balance<0
3. add nothing if the balance=0

Could somebody please let me know I this can be done, and if so, how to do it? I have checked help and searched online, but a solution eludes me.

I apologise in advance for my limited ability to understand and ask that suggestions be easy to comprehend.

I also thank all involved for helping make LibreOffice such a brilliant and successful software application. People who volunteer time to assist others using their intellect, knowledge and experience are just as valuable to a project as those who write the code, and are the reason why Open Source software is forging ahead.

Kind regards, Roger

edit retag close merge delete

## 1 Answer

Sort by » oldest newest most voted

This can be done with nested IF functions. eg put a number in cell A1 and in B1 put: =IF(A1>0,"credit",IF(A1<0,"debit","")) Change the number in A1 and B1 fulfills the additional text. The nested IF functions can be added to whatever other text is in the cell.

more

## Comments

Thanks for your prompt reply. When I added the formula to the cell it displays the formula, rather than the result of the formula. It is probably because I have overlooked something. I took a screenshot but can't see a way to include it. This is a copy and paste of the data in the cell for row 9: =IF(B9>0,"credit",IF(B9<0,"debit",""))

Hopefully you can point out my error?

( 2018-09-12 14:02:51 +0200 )edit

## Stats

Asked: 2018-09-12 12:48:26 +0200

Seen: 163 times

Last updated: Sep 12 '18