Skip to main content
Solved

IF Column One is prefixed A, then X

  • July 23, 2019
  • 5 replies
  • 40 views

Trying to achieve an outcome where:

IF Column One is prefixed 381 then Apple
If column one is prefixed 382 then orange
etc

Column 1
381-9287
382-2818
383-2812

Column 2
formula

Thanks!

Best answer by Kamille_Parks11

Cool, thanks!

How would I incorporate SWITCH(LEFT({Column 1}, 2), ‘5v’, ‘Blue’, ) and SWITCH(LEFT({Column 1}, 4), ‘123a’, 'Metal;) into the same formula as the one you wrote out above?


Well its not possible for anything to fit all those conditions so you could just write them all in the same formula separated by an ampersand.

SWITCH(LEFT({Column 1}, 2), '5v', 'Blue')&SWITCH(LEFT({Column 1}, 4), '123a', 'Metal')&SWITCH(LEFT({Column 1}, 3), '381', 'Apple', '382', 'Orange')

A nested IF() statement could also work.

5 replies

Kamille_Parks11
Forum|alt.badge.img+27

SWITCH(LEFT({Column 1}, 3), 381, 'Apple', 382, 'Orange')


  • Author
  • New Participant
  • July 29, 2019

SWITCH(LEFT({Column 1}, 3), 381, 'Apple', 382, 'Orange')


Hey Camille, thanks for your input! Unfortunately, the cell returns nothing with your formula…any ideas?


Kamille_Parks11
Forum|alt.badge.img+27

Hey Camille, thanks for your input! Unfortunately, the cell returns nothing with your formula…any ideas?


If Column 1 in your base is a text field as opposed to a number field, add single quotations around the 381 and 382 in the formula: SWITCH(LEFT({Column 1}, 3), '381', 'Apple', '382', 'Orange')


  • Author
  • New Participant
  • July 29, 2019

If Column 1 in your base is a text field as opposed to a number field, add single quotations around the 381 and 382 in the formula: SWITCH(LEFT({Column 1}, 3), '381', 'Apple', '382', 'Orange')


Cool, thanks!

How would I incorporate SWITCH(LEFT({Column 1}, 2), ‘5v’, ‘Blue’, ) and SWITCH(LEFT({Column 1}, 4), ‘123a’, 'Metal;) into the same formula as the one you wrote out above?


Kamille_Parks11
Forum|alt.badge.img+27

Cool, thanks!

How would I incorporate SWITCH(LEFT({Column 1}, 2), ‘5v’, ‘Blue’, ) and SWITCH(LEFT({Column 1}, 4), ‘123a’, 'Metal;) into the same formula as the one you wrote out above?


Well its not possible for anything to fit all those conditions so you could just write them all in the same formula separated by an ampersand.

SWITCH(LEFT({Column 1}, 2), '5v', 'Blue')&SWITCH(LEFT({Column 1}, 4), '123a', 'Metal')&SWITCH(LEFT({Column 1}, 3), '381', 'Apple', '382', 'Orange')

A nested IF() statement could also work.