Can I have a Numeric Formula field where the negative numbers (less than 0) are shown in red text? .

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered

Right now, I have the formula "[Registered Participants]-[Minimum Participants]". When the value is less than 0, I would like to show the value in red text.  Is this possible?

Photo of MJ Hickey

MJ Hickey

  • 0 Points

Posted 4 years ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,168 Points 50k badge 2x thumb
You can do this but it's more complicated than just applying a format like you might do in excel.  The only way to do this is to create a text string which happens to look like a number and is red if negative.  Normally in QuickBase it's not worth the effort, given that the field cannot be used in reports if you need a total as you have the alternative of putting up a  formula based warning message or using row colorization on reports.

But you have asked the question and given that your number will be small (way less than 1,000 where you would need to deal with commas) and you have no decimals here is an example of a  simple formula.  Note that you need to "Enable HTML" by checking the box in field properties.  There are more complicated formulas which deal with the more common request which would include larger numbers involving commas, typically Currency with 2 decimals.




If([My Number]<0, "<font color=red>" & ToText([My Number]), ToText([My Number]))
Photo of Gwen

Gwen

  • 0 Points
Do you know the more complicated formula that involves currency with 2 decimals?  That's what I ma looking for.

Thank you!

-g
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,168 Points 50k badge 2x thumb
I suggest that you post this as a new question.