Skip to main content

I can't believe a very simple feature in excel/google sheets is missing here in formulas when it comes to subtracting two numbers and if it's negative - show the number in one color, and if it's positive - show the number in another color 

so I have a pretty simple setup

Field 1:  Cal+/-

Formula is: 2300 - Cal   

results will be a number Less than 0, 0 or greater 

Formula is:  If({Cal+/-} < 0, ??, ??)

What do I use in the ?? to show less than 0 in red  or 0, greater than 0 in green  

Hello, 

I have been faced with the same issue and the only solution that I came up with was the following (someone may have a better solution):

Where "display value" is the formula :

IF(value>0, "🔴 " & value,
IF(value<0, "🟢 " & value,
"⚪ " & value
))
 
Regards,
 
Pascal

Thank you for the suggestion/solution.  I cant get the green circle to work but the red and white don't want to - they are showing. 

Not sure why its not working in the formula cause it's the same code that when I pasted it back here like this  - it works.

IF({Cal daily} < 0, "🔴"  & {Cal daily},
IF({Cal daily} > 0, "🟢" & {Cal daily},
"⚪"   & {Cal daily}
))
 
I am on Windows 10 Home with Chrome 127.0.6533.100 64 bit

Hello,

It seems that formula has been perverted when I pasted it into my message.

try to modify the formula by removing calls to "🔴" and to "⚪", and inserting icons of your choice using the key combination " windows + . "

Regards,

Pascal


Can you please try this formula

IF({Cal+/-} < 0, "Negative", IF({Cal+/-} > 0, "Positive", "Zero"))


Welcome to the world of databases. Although Airtable has many features that are similar to a spreadsheet, there are also some things that are fundamentally different. Having different colored text based on the formula result is one of those things that is simple for a spreadsheet but impossible in Airtable. Airtable does not let you customize the font color, size, stye, etc. the solution that Pascal provided of using a colored emoji is a good one.

If you are having trouble copy/pasting the emoji, you can go find the emoji you want somewhere else one the web and copy/paste it from there. Sometimes this forum does weird things with formatting. In general, if possible it is better to format formulas as code on this forum.

 

IF(

{Cal daily} < 0,

"🔴" & {Cal daily},

IF(

{Cal daily} > 0,

"🟢" & {Cal daily},

"⚪" & {Cal daily}

))

 


Hello,

It seems that formula has been perverted when I pasted it into my message.

try to modify the formula by removing calls to "🔴" and to "⚪", and inserting icons of your choice using the key combination " windows + . "

Regards,

Pascal


That worked.  Got my little happiness done 


Welcome to the world of databases. Although Airtable has many features that are similar to a spreadsheet, there are also some things that are fundamentally different. Having different colored text based on the formula result is one of those things that is simple for a spreadsheet but impossible in Airtable. Airtable does not let you customize the font color, size, stye, etc. the solution that Pascal provided of using a colored emoji is a good one.

If you are having trouble copy/pasting the emoji, you can go find the emoji you want somewhere else one the web and copy/paste it from there. Sometimes this forum does weird things with formatting. In general, if possible it is better to format formulas as code on this forum.

 

IF(

{Cal daily} < 0,

"🔴" & {Cal daily},

IF(

{Cal daily} > 0,

"🟢" & {Cal daily},

"⚪" & {Cal daily}

))

 


It was just replacing the icons.  Got it handled.


Reply