function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Arjun y 7Arjun y 7 

Formula fields to display first and next 45chars

Hi All,

My requirement is i have a "Description" field which contains 90chars. I need to store the first 45 chars in one formula field and next 45 chars in another formula field.

I tried with one i.e Formulafield1: TRIM(LEFT( Description , 45)). It is working fine.

Can i know any solution for the second formula field to display next 45 chars.

Thanks
 
mritzimritzi
Use Formula:
RIGHT( Description__c, 45)
to get last 45 characters

You can also use:
LEFT(Description__c, 45)
for first 45 characters.


Mark it as BEST ANSWER, if it solves your problem
 
Arjun y 7Arjun y 7
Hi Rizwan,

Thanks for the quick reply.

I don't want to display last 45 hrs. 

We need to display first 45 chars in one field and next 45 chars in another field.

For Example: If description field contains 85 chars, then first formula field should display first 45 chars and next 40 chars should display in another formula field. 

Any help is very much appreciated!
mritzimritzi
Following is possible fix:
RIGHT(Description__c,
    IF( LEN(Description__c)>45 , LEN(Description__c)-45, 0) 
)
This will populate data only if length of description is more than 45

TRIM removes spaces from text, use it only if you want to remove spaces.


Mark it as BEST ANSWER, if it solves your problem
Santosh Kumar 275Santosh Kumar 275
HI Arjun

1. For first half use this as formula for formula field.
TRIM(LEFT( Description__c , 45))
2. For next half use the below formula.
RIGHT(Description__c , IF( LEN( Description__c )>45 , LEN( Description__c )-45, 0) )
Jagjeet Singh 13Jagjeet Singh 13
Hi Arjun,
 As everyone else also suggested:
 1) You can use the below code. But use of the TRIM depends on your business requirement, decide on whether you want to count just the characters.
TRIM(LEFT( Description__c , 45))

2) For the second half you can use the below code. I would also sugggest you to make the Character length of 45 as dynamic by storing it into the custom label. Let me know if you want to know how to do it. 
RIGHT(Description__c , IF( LEN( Description__c )>45 , LEN( Description__c )-45, 0) )

 Hope this solves your problem! Please mark this as a best answer if you feel so!
Thanks.