Help

Conditional Formatting formula?

23265 19
cancel
Showing results for 
Search instead for 
Did you mean: 
Tamara_Bond-Wil
6 - Interface Innovator
6 - Interface Innovator

I see from the similar topics results that there is a feature request for conditional formatting - if that has been done, please mention how to find it, or if it is a paid option?

I’m trying to create a column that flags members of a specific category and their expiration date. SO - ideally, top level members (let’s say Platinum), with an expiration date greater than TODAY, would show in red, or have a checkbox or something. With expiration dates less than TODAY, would have an X.

The base currently contains a linked field for member category, and a field for expiration date. Suggestions on how to achieve the desired goal described above, either as formatting the record (or fields in the record) or by updating a flag field that has blanks, checks or Xs.

Thoughts?

19 Replies 19

AHA! :grinning: Thanks. Ok off to play with the logic again. (And re-read your post, to make sure I understood it)

Tamara_Bond-Wil
6 - Interface Innovator
6 - Interface Innovator

OK - still not working, although I did get the icons to show! :slightly_smiling_face: Do I have to have a field called “Today” in order for this formula to work? Because I have an expiration date of 12/31/2018 that’s still coming up as Remove Attributions.

12/31/2018 is AFTER TODAY(), so it is failing the IS_BEFORE() check. Just swap the positions of {Expiration Date} and TODAY() in the formula and it will be checking that TODAY() is before or the same as {Expiration Date}.

Tamara_Bond-Wil
6 - Interface Innovator
6 - Interface Innovator

And here I thought I excelled at logic. :persevere:

OK - that worked, and revealed another flaw in my logic - or rather, a forgotten piece, namely that all of the folks who aren’t Leaders or Patrons should have other flags, not “Remove Attributions”. But I’m going to see if I can follow the building logic and come up with the right fix.

Tamara

Tamara_Bond-Wil
6 - Interface Innovator
6 - Interface Innovator

Alright - I gave it my best shot, and something is still wrong. Here’s what I put:

‘’‘IF(
AND(
OR(
IS_BEFORE(
TODAY(),
{Expiration Date}
),
IS_SAME(
{Expiration Date},
TODAY(),
‘day’
)
),
OR(
{Sponsor Level} = “Leader: $15,000+”,
{Sponsor Level} = “Leader 2yr: $13,000+”,
{Sponsor Level} = “Patron: 24,000+”,
{Sponsor Level} = “Patron: 2yr: $22,000+”
)
),
“ :green_heart: Check Attributions”,
If(OR(
IS_BEFORE(
TODAY(),
{Expiration Date}
),
IS_SAME(
{Expiration Date},
TODAY(),
‘day’
),“ :green_heart: ”,
“ :x: Remove Attributions”
) ‘’’
The goal is to say “remove attributions” for everyone who has expired, but to differentiate the non expires from the top 4 and everyone else. (top 4 say “ :green_heart: Check Attributions”, everyone else not expired say: “ :green_heart: ” .

I was trying to follow the instructions for nested “if” statements according to Airtable, but the syntax must be wrong, because I can’t save. My head may explode.

First, check for me if this works:

IF(
  AND(
    OR(
      IS_BEFORE(
        TODAY(),
        {Expiration Date}
      ),
      IS_SAME(
        {Expiration Date},
        TODAY(),
        'day'
      )
    ),
    OR(
      {Sponsor Level} = "Leader: $15,000+",
      {Sponsor Level} = "Leader 2yr: $13,000+",
      {Sponsor Level} = "Patron: 24,000+",
      {Sponsor Level} = "Patron: 2yr: $22,000+"
    )
  ),
  "💚 Check Attributions",
  IF(
    OR(
      IS_BEFORE(
        TODAY(),
        {Expiration Date}
      ),
      IS_SAME(
        {Expiration Date},
        TODAY(),
        'day'
      )
    ),
    "💚",
    "❌ Remove Attributions"
  )
)

(you were just missing a couple closing parentheses)

Thanks - I suspected I was missing parenthesis, but I couldn’t see where. And… no - that still won’t save.

Sorry, Tamara,

I should have noticed before posting that I copied “smart quotes” out of your earlier post, and pasted them back in. Airtable doesn’t like “smart quotes” and rejects them in formulas for… reasons.

I’ve fixed all the smart quotes in the formula above, so you can try to copy-paste it as is again.

Worked! Thank you! What are “smart quotes”?

Tamara

A lot of text-processing software applications will seek to automatically detect the position of a quotation mark in the text, and based on it’s position, “curl” the quotation marks like you see there around my word “curl”, and around your words “smart quotes”. Those are smart quotes – it’s a purely aesthetic thing, that makes the quotation marks look better in the flow of text. However, they have a different unicode symbol representing them under the hood than "dumb" quotation marks, the ones that just go straight up and down, like you see around the word "dumb". Airtable only allows the unicode symbol for those dumb quotation marks in formulas.

When you type directly into the formula editor in Airtable, it produces dumb quotes; when you type into a code block (offset by triple back-ticks – ``` – ) here in these forums, it produces dumb quotes; when you type into a plain text editor like notepad or visual studio code, it produces dumb quotes.

However, when you type into most other formatted text applications, such as the post editing frame for this forum software, or MS Word, or your Email editor, you get smart quotes. If you copy and paste text out of something like that into the Airtable formula editor, you are copying and pasting the underlying unicode symbols for those characters (ie, you are often copying the unicode symbol for smart quotes, rather than the one for dumb quotes), and pasting those unicode symbols into Airtable’s formula editor. Same goes if you copy-paste text into a code block here in the forums.

You can tell the difference inside a code block by the coloration of text inside the quotation marks. When dumb quotes are used, the text inside turns red, indicating that the code block is recognizing a string surrounded by dumb quotes. However, the code block won’t recognize smart quotes, and so the text inside will not be colored red:

IF({Donor} = "24,000+ Annual", ...)

IF({Donor} = “24,000+ Annual”, ...)

I should have noticed, when I originally pasted my edited version of your formula back into the forums, that the strings did not print out in the color red – that was a clue to me that I had the wrong kind of quotes in my formula :slightly_smiling_face: