This website uses Cookies. Click Accept to agree to our website's cookie use as described in our Privacy Policy. Click Preferences to customize your cookie settings.

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Airtable Community
- Discussions
- Ask A Question
- Formulas
- IF formula with emoji

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Topic Labels:
Formulas

Solved

Jump to Solution

0
1536
17

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Comment Post Options

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Jun 11, 2020 08:48 AM

Hi!

Can someone tell me why my formula is not working?

IF({Rating}=1,

” :star: ”,

IF({Rating}=2,

” :star: :star: ”,

IF({Rating}=3,

” :star: :star: :star: ”,

IF({Rating}=4,

” :star: :star: :star: :star: ”,

IF({Rating}=5,

” :star: :star: :star: :star: :star: ”,

)))))

Basically, I want to convert a lookup value of integers into an emoji.

Many thanks.

Solved! Go to Solution.

1 Solution

Accepted Solutions

Solved
See Solution in Thread

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Jun 14, 2020 12:33 PM

Reply

17 Replies 17

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Jun 11, 2020 09:00 AM

What field type is your `{Rating}`

field? Is it a number that you’ve manually entered? Is it a lookup/rollup from another table? Is it Airtable’s own rating field?

Type aside (for now), you could simplify this by using the `REPT()`

function, which repeats a given item a specified number of times.

```
REPT("⭐️", Rating)
```

If `{Rating}`

is 5, you’ll get five stars. If it’s 50, you’ll get 50 stars. The number directly drives the output.

Reply

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Jun 11, 2020 10:06 AM

Your formula has an extra comma at the end. That is why it isn’t working. You can remove the last comma before the closing parenthesis. (This is a very common error.)

```
IF({Rating}=5,
"⭐️⭐️⭐️⭐️⭐️", <=== here is the extra comma
)))))
```

Or you can use @Justin_Barrett’s formula, which is a bit more flexible.

Reply

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Jun 12, 2020 12:29 AM

Reply

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Jun 12, 2020 12:30 AM

I tried it without the comma, it still didn’t work. Strange…

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Jun 12, 2020 12:56 AM

Reply

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Jun 12, 2020 01:14 AM

Since I have you two experts, can I ask if there is a sleeker way to write this formula?

{K1 age} & IF(AND({K1 age}, OR({K2 age}, {K3 age}, {K4 age}, {K5 age})), ", ")

& {K2 age} & IF(AND({K2 age}, OR({K3 age}, {K4 age}, {K5 age})), ", ")

& {K3 age} & IF(AND({K3 age}, OR({K4 age}, {K5 age})), ", ")

& {K4 age} & IF(AND({K4 age}, {K5 age}), ", ")

& {K5 age}

Basically I have 5 fields of kids ages (K1 to K5), but not everyone has 5 kids. I want to put all the ages together e.g. 10, 5, 2 and not have a result like 10, 5, 2, , , . So that was the formula I used - it works but I thought there might be a better way.

Thanks so much for your help so far!!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Jun 12, 2020 08:24 AM

Braces are only required if the field name contains spaces and/or certain special characters. For example, if you use an emoji as a field name (which is valid), it will require braces.

Yes, this can be simplified. All you need to do with each field after `{K1 age}`

is look to see if its value exists. If it does, add the comma and the field value.

```
{K1 age} & IF({K2 age}, ", " & {K2 age})
& IF({K3 age}, ", " & {K3 age})
& IF({K4 age}, ", " & {K4 age})
& IF({K5 age}, ", " & {K5 age})
```

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Jun 14, 2020 01:46 AM

Solved
See Solution in Thread

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Jun 14, 2020 12:33 PM

Reply

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Jun 15, 2020 12:47 PM

`{K1 age}`

field and enter the first child’s age into `{K2 age}`

instead?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Jun 15, 2020 08:41 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Jun 15, 2020 09:10 PM

In that case, here’s an alternate way to approach it:

```
SUBSTITUTE(
TRIM({K1 age} & IF({K2 age}, " " & {K2 age})
& IF({K3 age}, " " & {K3 age})
& IF({K4 age}, " " & {K4 age})
& IF({K5 age}, " " & {K5 age}))
, " ", ", "
)
```

This will work no matter where the numbers are placed.

Reply

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Jun 16, 2020 08:17 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Jun 16, 2020 08:43 AM

There’s no way to track how much processing power a formula uses. My hunch is that the difference between them is negligible.

What do you mean by “host it ourselves?” Airtable runs completely online. There’s no local hosting option.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Jun 16, 2020 10:14 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Jun 17, 2020 06:53 AM

Reply

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Jun 17, 2020 07:07 AM

I just had a bad experience with excel on a Mac a while ago. Can’t believe MS excel doesn’t allow multi-core Macs to maximise processing power - only one core will be used for processing. I wrote a very clunky formula. And it took me hours/days to get a response for a whole table.

Thanks SO much for your time on this. So much appreciated.

Reply