Help

Help with a formula not allowing me to format as number

Topic Labels: Formulas
Solved
Jump to Solution
1553 3
cancel
Showing results for 
Search instead for 
Did you mean: 
Cathy_Anderson
6 - Interface Innovator
6 - Interface Innovator

I have rate fields low, mid, high.
The rate fields are lookups - formatted as decimals.

Then I have a formula field
IF(rate = “low”, {low rate}, IF(rate = “mid”, {mid rate}, IF(rate=“high”, {high rate},"")))
which results in the correct number, but the formula will not allow me to format as a number.

What am I overlooking?
Thanks!

1 Solution

Accepted Solutions
ScottWorld
18 - Pluto
18 - Pluto

For your final “”, swap it out for BLANK() instead.

So your formula would look like this:

IF(rate = “low”, {low rate}, IF(rate = “mid”, {mid rate}, IF(rate=“high”, {high rate},BLANK())))

The final “” that you originally had in your formula yielded a “string” result (i.e. a “text” result). If Airtable’s formula engine sees that your formula can have any other results BESIDES a number, then it won’t let you format your formula as a number.

It would actually be really cool if Airtable’s formula engine was smart enough to see multiple different results within your formula — and then let you set a bunch of different types of formatting for the formula field (based on the different types of results that your formula might yield).

But since it doesn’t do that, you would need to make sure that all of your results end up a number.

Luckily, the BLANK() function doesn’t actually result in a string/text (according to Airtable’s formula engine), so then you can apply number formatting – if all of your other formula results end in a number.

See Solution in Thread

3 Replies 3
ScottWorld
18 - Pluto
18 - Pluto

For your final “”, swap it out for BLANK() instead.

So your formula would look like this:

IF(rate = “low”, {low rate}, IF(rate = “mid”, {mid rate}, IF(rate=“high”, {high rate},BLANK())))

The final “” that you originally had in your formula yielded a “string” result (i.e. a “text” result). If Airtable’s formula engine sees that your formula can have any other results BESIDES a number, then it won’t let you format your formula as a number.

It would actually be really cool if Airtable’s formula engine was smart enough to see multiple different results within your formula — and then let you set a bunch of different types of formatting for the formula field (based on the different types of results that your formula might yield).

But since it doesn’t do that, you would need to make sure that all of your results end up a number.

Luckily, the BLANK() function doesn’t actually result in a string/text (according to Airtable’s formula engine), so then you can apply number formatting – if all of your other formula results end in a number.

Or just leave out the blank (and make sure you use straight quotes instead of curly quotes).

IF(rate = "low", {low rate}, IF(rate = "mid", {mid rate}, IF(rate="high", {high rate})))

Or use a switch statement:

SWITCH(rate,
  "low", {low rate}, 
  "mid", {mid rate}, 
  "high", {high rate}
)
Cathy_Anderson
6 - Interface Innovator
6 - Interface Innovator

Thank you both! I appreciate such a quick solution