Skip to main content
Solved

If column A contain X - display value of column A, if contain Y, display value of column B

  • August 2, 2021
  • 8 replies
  • 39 views

  • Participating Frequently

Hello guys,

I’m just getting started with Airtable formulas and couldn’t find the right formula for this scenario and will be grateful if you could help here.

I’ve 2 columns when based on the value on column A I want to determent if to display a value of column A or column B in the D column.

= If column A contains 1 or 2 or 3, then display the value of column A, if contain Y, display value of column B

Thanks

Best answer by kuovonne

You’re missing a closing parenthesis for the OR() statement.

If “Office”, “Hybrid”, and “Remote” are the whole values of the field {Workplace} you could simplify the formula by using a SWITCH() statement.

SWITCH(
   {Workplace},
   "Office", {Company - Location},
   "Hybrid", {Company - Location},
   "Remote", {Workplace}
)

Edited to remove extra comma.


You have an extra comma. Remove the comma after {Workplace} and before the closing parenthesis.


You have multiple syntax issues with this formula, include issues with extra spaces after your function names, curly quotes, and missing parenthesis.

Try this …

IF(
    OR(
        FIND("Office", {Workplace}), 
        FIND("Hybrid", {Workplace})
    ),
    {Company - Location},
IF(
    FIND("Remote", {Workplace}), 
    {Workplace}
))

8 replies

Adnan_Ahmed
Forum|alt.badge.img+16
  • Inspiring
  • August 2, 2021

It would be something along these lines:

IF(OR (FIND (“1”, {Column A}), FIND (“2”, {Column A}), FIND (“3”, {Column A})), {Column A},
IF(FIND(“Y”, {Column A}), {Column B}))


  • Author
  • Participating Frequently
  • August 2, 2021

It would be something along these lines:

IF(OR (FIND (“1”, {Column A}), FIND (“2”, {Column A}), FIND (“3”, {Column A})), {Column A},
IF(FIND(“Y”, {Column A}), {Column B}))


@Jarvis_Digital hanks but I’ve tried this and didn’t work.

Can you have a look?
IF(OR (FIND (“Office”, {Workplace}), FIND (“Hybrid”, {Workplace}),{Company - Location},
IF(FIND(“Remote”, {Workplace}), {Workplace}))


Kamille_Parks11
Forum|alt.badge.img+27

@Jarvis_Digital hanks but I’ve tried this and didn’t work.

Can you have a look?
IF(OR (FIND (“Office”, {Workplace}), FIND (“Hybrid”, {Workplace}),{Company - Location},
IF(FIND(“Remote”, {Workplace}), {Workplace}))


You’re missing a closing parenthesis for the OR() statement.

If “Office”, “Hybrid”, and “Remote” are the whole values of the field {Workplace} you could simplify the formula by using a SWITCH() statement.

SWITCH(
   {Workplace},
   "Office", {Company - Location},
   "Hybrid", {Company - Location},
   "Remote", {Workplace}
)

Edited to remove extra comma.


  • Author
  • Participating Frequently
  • August 2, 2021

You’re missing a closing parenthesis for the OR() statement.

If “Office”, “Hybrid”, and “Remote” are the whole values of the field {Workplace} you could simplify the formula by using a SWITCH() statement.

SWITCH(
   {Workplace},
   "Office", {Company - Location},
   "Hybrid", {Company - Location},
   "Remote", {Workplace}
)

Edited to remove extra comma.


Where exactly?

It didn’t work as well…

I’m running out of ideas…


Kamille_Parks11
Forum|alt.badge.img+27

Where exactly?

It didn’t work as well…

I’m running out of ideas…


The formula you pasted looks like this: OR(FIND(), FIND(). It needs to look like this: OR(FIND(), FIND())

Be more specific. It produced an error and wouldn’t let you save the formula? Its not showing the desired result?


kuovonne
Forum|alt.badge.img+29
  • Brainy
  • Answer
  • August 3, 2021

You’re missing a closing parenthesis for the OR() statement.

If “Office”, “Hybrid”, and “Remote” are the whole values of the field {Workplace} you could simplify the formula by using a SWITCH() statement.

SWITCH(
   {Workplace},
   "Office", {Company - Location},
   "Hybrid", {Company - Location},
   "Remote", {Workplace}
)

Edited to remove extra comma.


You have an extra comma. Remove the comma after {Workplace} and before the closing parenthesis.


You have multiple syntax issues with this formula, include issues with extra spaces after your function names, curly quotes, and missing parenthesis.

Try this …

IF(
    OR(
        FIND("Office", {Workplace}), 
        FIND("Hybrid", {Workplace})
    ),
    {Company - Location},
IF(
    FIND("Remote", {Workplace}), 
    {Workplace}
))

Kamille_Parks11
Forum|alt.badge.img+27

You have an extra comma. Remove the comma after {Workplace} and before the closing parenthesis.


You have multiple syntax issues with this formula, include issues with extra spaces after your function names, curly quotes, and missing parenthesis.

Try this …

IF(
    OR(
        FIND("Office", {Workplace}), 
        FIND("Hybrid", {Workplace})
    ),
    {Company - Location},
IF(
    FIND("Remote", {Workplace}), 
    {Workplace}
))

Good 'ol syntax issues, lol


  • Author
  • Participating Frequently
  • August 3, 2021

You have an extra comma. Remove the comma after {Workplace} and before the closing parenthesis.


You have multiple syntax issues with this formula, include issues with extra spaces after your function names, curly quotes, and missing parenthesis.

Try this …

IF(
    OR(
        FIND("Office", {Workplace}), 
        FIND("Hybrid", {Workplace})
    ),
    {Company - Location},
IF(
    FIND("Remote", {Workplace}), 
    {Workplace}
))

Thank you. It does the job perfectly!