Jul 10, 2017 03:20 AM
Hi there,
I’m trying to replicate some spreadsheet conditional formatting for some data that I require publishing with some specific rules around precision - I can’t seem to replicate this using the functions that are available in Airtable (or so I think).
Has anyone found a way to display numbers in formats like this:
Rules:
If < 1, then 2 decimal places.
If < 10, then 1 decimal place,
If >= 10, then 0 decimal places.
So in theory I would get the following numbers:
0.1623 -> 0.16
0.2688 -> 0.27
1.2344 -> 1.2
3.3759 -> 3.4
12.6984 -> 13
etc.
I have tried using ROUND(Value,if(value<10,1,0))
But as this ultimately depends on the precision setting this doesn’t display what I need.
Is there a way to recreate an excel function;
=TEXT(Value,if(Value<10,“0.0”,“0”))
Any tips would be appreciated!
Jul 10, 2017 07:18 AM
Maybe you can turn it around by using three if statements with round inside 'm & adding these up?
Jul 10, 2017 08:01 AM
Thanks for the suggestion - I’ve just tried that but comes up against the same problem with the other way around - the precision factor is set by the field and I can’t override.
Thanks though :slightly_smiling_face:
Jul 10, 2017 08:25 AM
Ah. I see.
Apparently you can only do this if you don’t mind converting the numbers to text. If you add:
& ""
somewhere in the formula, the field won’t be formatted as a number.
Jul 10, 2017 08:37 AM
Hmm, interesting that may work!
Edit: Just tried it - this works perfectly. Great suggestion, thanks
Jul 10, 2017 08:51 AM
My pleasure. :slightly_smiling_face: