Help

Re: Blank() & Zero problem

5080 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Tuur
10 - Mercury
10 - Mercury

Hi guys,

When I’m using Blank() in a formula (to flag empty fields) it also counts the number ‘0’ as a blank, and the other way around.

So when I have a formula that says {MyNumberField} = 0 it also registers the empty fields as zeroes.

Has this always been the case? At the very least I’d expect the more specific {MyNumberField} = Blank() to neglect ‘0’ fields.

Arthur.

Schermafbeelding 2017-08-01 om 10.32.43.png

17 Replies 17
Jeff_Kemp
6 - Interface Innovator
6 - Interface Innovator

currency and number fields do not handle “0” and blank values differently: “field = BLANK()” results in TRUE if blank OR zero “0” ( OR(field = BLANK(), field = 0 ), results in FALSE if checking for “field = 0” even if you enter zero “0” dollars as a value

row1 field = 0: blank = TRUE, field = 0 TRUE

row2 field = empty: blank = TRUE, field = 0 TRUE

Also:

{test number}<.1 evaluates to true when {test number} = 0

{test number}<.1 evaluates to true when {test number} is blank
Airtable 2022-01-12 at 9.32.29 AM

Joshua_Penningt
4 - Data Explorer
4 - Data Explorer

This is still an issue in 2022. My formula returns the override if its anything greater than zero but ignores if it is zero because it does not recognize zero as a value. And since the rest of the formula relies on heavy math and not just true false logic there doesn’t seem to be a workaround.

F(AND({Expense Approval}=BLANK(),{How is this being paid for?}=“Agent PP”),IF({PP Override}=BLANK(),SUM(IF({Materials/Vendor Cost}=BLANK(),IF({Estimated Material/Vendor Cost}=BLANK(),(Quantity{Estimated Per/Unit Cost}),{Estimated Material/Vendor Cost}),{Materials/Vendor Cost}),IF({Time Spent}=BLANK(),({Estimated Design Time}{External Design Rate}),(((CEILING({Time Spent}/3600)3600)/3600){External Design Rate*}))),{PP Override}))

Screen Shot 2022-03-08 at 3.51.31 PM

Welcome to the Airtable community!

@Joshua_Pennington think I answered this question for you on the Facebook community.

For others who might find this thread, here is the gist of the solution.

Instead of …

IF( {override field}, {override field}, {original field})

use …

IF( {override field} & "", {override field}, {original field})

This converts the number field into a string. If the number field is truly blank, the resulting string will still be “false”, but if the number field has the value of zero, the resulting string will be “true”.

Which is basically what I propose in the second post. :slightly_smiling_face:

I’m pretty sure by now we can forget about this behavior ever being changed as it will most likely have way too much impact on current implementations. That still doesn’t make it ‘right’ though.

Never mind. :slightly_smiling_face: Apparently the additional LEN trick is not needed (anymore?) as casting it as a string works great.

Yes! This ended up working perfectly. I’m looking forward to learning from you at the Daretable conference.

Giorgio_Bazziga
6 - Interface Innovator
6 - Interface Innovator

Not sure if needed anymore but my solution is to check if the formula equaled 0 and write 0 as text instead of integer:

IF([formula that could equal 0]=0,"0",[formula that could equal 0])