Help

I just spent 10 minutes looking for an answer to what I thought was a simple question

Topic Labels: Data Formulas
Solved
Jump to Solution
1734 7
cancel
Showing results for 
Search instead for 
Did you mean: 
RonniEloff_VKDe
8 - Airtable Astronomer
8 - Airtable Astronomer

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  

1 Solution

Accepted Solutions

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):

Pascal_Gallais_0-1723474805651.png

Where "display value" is the formula :

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

See Solution in Thread

7 Replies 7

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):

Pascal_Gallais_0-1723474805651.png

Where "display value" is the formula :

IF(value>0, "🔴 " & value,
IF(value<0, "🟢 " & value,
" " & value
))
 
Regards,
 
Pascal
RonniEloff_VKDe
8 - Airtable Astronomer
8 - Airtable Astronomer

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. 

formula.png

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 ":red_circle:" and to ":white_circle:", and inserting icons of your choice using the key combination " windows + . "

Regards,

Pascal

Saravanan_009
8 - Airtable Astronomer
8 - Airtable Astronomer

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}
))

 

That worked.  Got my little happiness done 

It was just replacing the icons.  Got it handled.