May 07, 2019 02:13 PM
Hello fellow Airtablers!
I’m in a bit of a bind trying to put together a formula for what I’m trying to do here.
I have 3 different single select fields, which based on if they meet certain criteria, will populate another formula field that’ll show “Complete” or “Incomplete”. That formula is working wonderfully. However, I’m trying to come up with a formula that’ll state the reason as to Why it’s showing as incomplete.
I can sort of get it to work for one field, but not multiple.
Here is the formula I have for the field that populates with “Complete” or “Incomplete”:
IF(AND(Status = "Done", {Billing Status} = "Payment Received", {E-file Status} = "Accepted", {Billed}!=BLANK()), "✔ Complete", "❌ Incomplete")
Here’s an image of what it looks like:
As you can see, it’s marked as Incomplete, because the billing status is not marked as “Payment Received”.
I’m attempting to create a column after the {Final Status} column that will show why it’s marked “Incomplete”. Is this possible?
Any help or suggestions are greatly appreciated. I’m still a bit new to Airtable and am trying to learn as much as I can.
Thanks in advance!
Solved! Go to Solution.
May 07, 2019 04:03 PM
I think this will get you what you are looking for:
IF({Status} != "Done", {Status}) &
IF(
AND(
{Status} != "Done",
OR(
{Billing Status} != "Payment Received",
{Billed} = BLANK(),
{E-file Status} != "Accepted"
)
),
" || "
) &
IF({Billing Status} != "Payment Received", {Billing Status}) &
IF(
AND(
{Billing Status} != "Payment Received",
OR(
{Billed} = BLANK(),
{E-file Status} != "Accepted"
)
),
" || "
) &
IF({Billed} = BLANK(), "Missing Billed Amount") &
IF(
AND(
{Billed} = BLANK(),
{E-file Status} != "Accepted"
),
" || "
) &
IF({E-file Status} != "Accepted", {E-file Status})
May 07, 2019 03:12 PM
I’ve been playing around with it and "Sort of" got it to work. Granted I’m sure my formula’s quite sloppy.
Here’s my current formula:
IF({Status} != "Done", {Status}) & IF({Billing Status} != "Payment Received", {Billing Status}) & IF({Billed} = BLANK(), "Missing Billed Amount") & IF({E-file Status} != "Accepted", {E-file Status})
I’ve got it to pull from those fields if they don’t meet certain criteria, but now how do I separate them properly?
May 07, 2019 03:30 PM
Since you are using concatenation (&
), you can just concatenate arbitrary text in-between with each conditional.
For example:
IF({Status} != "Done", {Status} & " || ") &
IF({Billing Status} != "Payment Received", {Billing Status} & " || ") &
IF({Billed} = BLANK(), "Missing Billed Amount || ") &
IF({E-file Status} != "Accepted", {E-file Status})
You can use any other separating characters you want if you don’t like the pipe characters.
May 07, 2019 03:42 PM
I did think of that as well, and tried doing the ", " to separate them.
Maybe I’m just a neat freak or a bit of a perfectionist, but it ends up looking sloppy.
For example, what if it only meets the criteria for one of the IF statements; It’d look something like:
“Done,” with nothing after it.
Same would go for the “||” pipes; “Done ||”
Is there a way to only include separators if there is more than one criteria met?
Does that make sense?
May 07, 2019 03:43 PM
Yep… just takes a good bit of logic is all :slightly_smiling_face:
May 07, 2019 03:43 PM
Mind pointing me in the right direction? I’m trying my best to learn and practice what I do end up learning.
May 07, 2019 03:49 PM
IF({Status} != "Done", {Status}) &
IF(
OR(
{Billing Status} != "Payment Received",
{Billed} = BLANK(),
{E-file Status} != "Accepted"
),
" || "
) &
IF({Billing Status} != "Payment Received", {Billing Status}) &
>>Insert IF(OR()) here to print separator<<
IF({Billed} = BLANK(), "Missing Billed Amount") &
>>Insert IF(OR()) here to print separator<<
IF({E-file Status} != "Accepted", {E-file Status})
I’d suggest getting yourself a good text editor for writing your complex Airtable formulas – writing them in Airtable’s built-in formula editor is less than pleasant. I use Visual Studio Code myself.
It looks like this:
May 07, 2019 03:57 PM
I’m having issues getting the code to work.
Are the “>>Insert IF(OR))” sections preventing me, do you think?
I’m trying to understand the logic of it all.
May 07, 2019 03:58 PM
I did also download Visual Studio Code, but I’ll have to play around with that later to get a better understanding of how it works.
May 07, 2019 03:59 PM
Yes, sorry @Dakota_Bushnell, I was not very clear there.
I wrote the first bit of IF(OR())
logic for you after the first field check.
The spots between the >> ... <<
are where I intended for you to try your hand at writing an IF(OR())
statement to do something similar, for learning purposes.