Skip to main content

The following formula returns 3 values:

 

DP 1948P 5527-02 or DP 1948P 5

 

CASE(Production_Plant__c, "CD", "CD", "DP", "DP", "None", "", null ) & Product__r.Name & IF(ISNUMBER(RIGHT(Product__r.Name,1)),"-","") & IF(CONTAINS(TEXT(Packaging_Type__c), "-"), LEFT(TEXT( Packaging_Type__c ),1), TEXT( Packaging_Type__c )) 

 

 -CASE(Production_Plant__c has CD, DP, None or Null) 

returns: DP  

- Product__r.Name  

returns: 1948P  

- IF(ISNUMBER(RIGHT(Product__r.Name,1)),"-","")  

returns: 1948P  

 

Two values thus far: DP1948P  

The 3rd value is the problem.  The Packaging_Type__c is 5527-02 and meets the condition. The LEFT command returns 5 TEXT command converts to 5 to Text  

The results is DP1948P5. We need it to be DP1948P5527-02.  

 

If I increase LEFT value to 10 it will select the correct standard product, LEFT(TEXT( Packaging_Type__c ),1), however it will fail when I try re-enter due to because  there is no  Packaging Type, 5 - Stand 

 

The values for Packaging Type: 

5527-02 5 - Standard Bags  

 

Any ideas? Is there a way to do multiple conditions as shown below:

 

IF CASE( Production_Plant__c, "CD", "CD", "DP", "DP", "None", "", null ) & Product__r.Name & IF(ISNUMBER(RIGHT(Product__r.Name,1)),"-","") &  IF(CONTAINS(TEXT(Packaging_Type__c), ""),  LEFT(Packaging_Type__c ),10), TEXT( Packaging_Type__c ),

ELSE

IF(CONTAINS(TEXT(Packaging_Type__c), "-"), LEFT(Packaging_Type__c ),1), TEXT( Packaging_Type__c )  

 

@Formulas - Help, Tips and Tricks 

5 个回答
0/9000