Skip to main content
Solved

Help with an if then concatenated formula

  • February 6, 2022
  • 4 replies
  • 36 views

Forum|alt.badge.img+11

For a casting agency db I need to set a personalized filter column

I have a field with the age, now I need a formula column that gives me the segment :point_down:t2:

AGE CALCULATED COLUMN
< 15 kids
=> 15 & < 18. teenagers
=> 18 & < 31 young
=> 31 & < 45 mature
=> 45 older

I’ve been trying to make an if then concatenated formula but I’m always getting errors.

Any help? :pray:

Best answer by Alexey_Gusev

Thanks Alexey.

I’m getting an error. Maybe am I missing something?


i think, it’s quotes, the forum substituted usual symmetric single quote
by left/right quotes…
my fault, i should have select formula text to avoid it.
correct version (substitute only lower part, with quotes)

Switch(
(age>15)+(age>18)+(age>31)+(age>45)

,0,'kids'
,1,'teenagers'
,2,'young'
,3,'mature'
,4,'older'
)

4 replies

Alexey_Gusev
Forum|alt.badge.img+25

Switch(
(age>15)+(age>18)+(age>31)+(age>45)
,0,‘kids’
,1,‘teenagers’
,2,‘young’
,3,‘mature’
,4,‘older’
)


Forum|alt.badge.img+11
  • Author
  • Known Participant
  • February 6, 2022

Switch(
(age>15)+(age>18)+(age>31)+(age>45)
,0,‘kids’
,1,‘teenagers’
,2,‘young’
,3,‘mature’
,4,‘older’
)


Thanks Alexey.

I’m getting an error. Maybe am I missing something?


Alexey_Gusev
Forum|alt.badge.img+25
  • Brainy
  • Answer
  • February 6, 2022

Thanks Alexey.

I’m getting an error. Maybe am I missing something?


i think, it’s quotes, the forum substituted usual symmetric single quote
by left/right quotes…
my fault, i should have select formula text to avoid it.
correct version (substitute only lower part, with quotes)

Switch(
(age>15)+(age>18)+(age>31)+(age>45)

,0,'kids'
,1,'teenagers'
,2,'young'
,3,'mature'
,4,'older'
)

Forum|alt.badge.img+11
  • Author
  • Known Participant
  • February 6, 2022

i think, it’s quotes, the forum substituted usual symmetric single quote
by left/right quotes…
my fault, i should have select formula text to avoid it.
correct version (substitute only lower part, with quotes)

Switch(
(age>15)+(age>18)+(age>31)+(age>45)

,0,'kids'
,1,'teenagers'
,2,'young'
,3,'mature'
,4,'older'
)

I see! Thanks so much. It works like a charm! :grinning: