Skip to main content
Solved

Look up certain symbol in text

  • December 18, 2023
  • 3 replies
  • 302 views

Forum|alt.badge.img+1

Hello, 

I have a dimension list with 1 column where all items are in the following format: XYZ or XY/ABC. 

 

I would like to add now a second column that will have 2 possible values: Product A or Product B (TEXT). 
-If you detect a “/” in the cell, please say Product A
-If not, please say Product B

I believe it is a variation of using if contains/mid.. however, I do not find the right formula. Would it be possible to help? 

Thank you very much! 

Best answer by Issam Moalla

@Olivia Van Gerven , it can also be solved with contains like you mentionned:

IF(CONTAINS("/",Items.Name), Product."Product A", Product."Product B")

 

3 replies

Issam Moalla
Employee
Forum|alt.badge.img+11
  • Employee
  • December 18, 2023

Hi @Olivia Van Gerven ,

In this case I would suggest using a combination of the FIND function and ISDEFINED:
So the formula would be:

IF(ISDEFINED(FIND("/",Items.Name)), Product."Product A", Product."Product B")

Where: 

  • FIND would return the first occurence if the symbol you are looking for exists or a BLANK 
  • ISDEFINED would flag as true the lines where there is a value

Hope this helps,
Issam


Issam Moalla
Employee
Forum|alt.badge.img+11
  • Employee
  • Answer
  • December 18, 2023

@Olivia Van Gerven , it can also be solved with contains like you mentionned:

IF(CONTAINS("/",Items.Name), Product."Product A", Product."Product B")

 


Forum|alt.badge.img+1

Hello, 

 

This works indeed, thank you very much!