Text Rule Query

Schrodinger,
Nothing "fancy" required. The big question is whether this value that you would like to test is entered directly or if it is the result of some calculation.
If it's a direct entry, it's not possible to test it and add text in the same cell. Your added text could be in the adjacent column, and if you remove the cell border it might look enough like it is in the same column to please you.
If calculated, it's a simple IF function in the same cell.
Jerry

Like (0)


It's entered as a result of a calculation.
So not being too knowledgeable on Functions and how to write or use them how could I use the IF function to say
IF the value in cell A1 is greater or equal to 0 then write In Credit Is it IF A1> or = 0 then 'In Credit'
or
IF the value in cell A1 is less 0 then write In Debit Is it IF A1 < 0 then 'In Debit'
Thanks

Like (0)


In the cell with the calculation you would modify it in this way:
=IF(YourCalculation <0, "In Debit", "In Credit")
Jerry

Like (0)


Thanks Jerry.

Like (0)


Schrodinger,
I made a mistake, forgetting that you would like to add the text to the calculation, not replace the calculation. So, do this:
=YourCalculation & IF(YourCalculation <0, " In Debit", " In Credit")
Sorry for the confusion.
Jerry

Like (0)


No problem Jerry. Thanks for taking the time and trouble.

Like (0)


Hi Schodinger56,
If the value displayed in this cell is an END result (ie. a result that will not be used in further calculations), then combining the result of the calculation with a text string as requested will work.
But if the numerical part of the result is to be used in later calculations, the formulas for those calculations will need to be written to extract the part of the string (eg "75.05" from "75.05 in credit") representing the number before performing the calculations. Keeping the 'label' in a separate cell simplifies any formulas further downstream.
Regards,
Barry

Like (0)


HI Barry
It is the final result and won't be used in any further calculations.
Thanks

Like (0)


Schrodinger,
It's not a difficult problem to recover the numeric calculation result. For instance, if the expression is in Column B, the value portion can be recovered by writing:
=LEFT(B, FIND("In", B)2)
However, it might be easier just to repeat the expression that was used to calculate the value in column B.
Jerry

Like (0)
