0

I have the following string: XXXX.C.2.0.1

how do I extract just the "C"?

thanks

Luis Carvalho
  • 483
  • 1
  • 11
  • 27
  • SharePoint Online? On-Premise? 2010, 2013? How do you want to get the "C"? Javascript? Directly in the form? Please give us some more information... – Patrick Jun 19 '15 at 11:53
  • 1
    Maybe it's possible to do it shorter and more readable, but this should to the trick. You can replace the hardcoded string with a column if you want =LEFT( RIGHT("XXXX.C.2.0.1", LEN("XXXX.C.2.0.1")-INT(FIND(".","XXXX.C.2.0.1")-1)-1), INT(FIND(".",RIGHT("XXXX.C.2.0.1", LEN("XXXX.C.2.0.1")-INT(FIND(".","XXXX.C.2.0.1")-1)-1))-1)) – Dolgsthrasir Jun 19 '15 at 12:36

1 Answers1

-2

Source Using calculated field to retrieve substring of another field Suppose for example you have a field that contain the following data as in the above link :

==========================
|  Email Address         |
==========================
| Jack@wonderland.com    |
| Peter@nobodyland.com   |
| Jill@wonderland.com    |
==========================

And if you want to have the following result as shown below by removing the sub-strings from the Email Address column and display them in each indiviual UserName and Domain column

===========================================================
|  Email Address         |  UserName  |      Domain       |
===========================================================
| Jack@wonderland.com    |   Jack     |   wonderland.com  |
| Peter@nobodyland.com   |   Peter    |   nobodyland.com  |
| Jill@wonderland.com    |   Jill     |   wonderland.com  |
===========================================================

You can use the following method

  1. Create Calculated column called "UserName" and type in this formula

    =LEFT([Email Address],INT(FIND("@",[Email Address])-1))

  2. Create Calculated column called "Domain" and type in this formula

    =RIGHT([Email Address],LEN([Email Address])-INT(FIND("@",[Email Address])))

It should work.

And in your case you can modify the formula as per your needs. The above is just an example for the Calculated column formula

Manish Oswal
  • 863
  • 1
  • 5
  • 10
  • Seems like a copy from here http://sharepoint.stackexchange.com/questions/29140/using-calculated-field-to-retrieve-substring-of-another-field. Flag question as duplicate instead if you think it is one. – Dolgsthrasir Jun 19 '15 at 12:08
  • Please attribute the source Manish, blatently ripping off a question and answer without attribution may result in your post being deleted. – Eric Alexander Jun 19 '15 at 12:13
  • i did not had an option to flag the question as duplicate so i copied the answer from the above post. and i am sorry i forgto to mention the source. – Manish Oswal Jun 19 '15 at 15:27