Home > Blockchain >  Extract First chracter of all words except the first one
Extract First chracter of all words except the first one

Time:01-10

I have list of names and i am tryign to extract the First word then First character of 2nd word and 3rd character of 3rd work and so on...

I was only able to make this formula but it works till 2nd name how to achieve further any help will be much appreciated.

=LEFT(D4,FIND(" ",D4)-1)&" "&LEFT(LEFT(D4,SEARCH(" ",D4)-1),1)

enter image description here

[enter link description here][2]

[2]:

enter image description here


update:

=ARRAYFORMULA(IFNA(TRIM(REGEXEXTRACT(B2:B, "\w ")&" "&
 BYROW(B2:B, LAMBDA(x, TEXTJOIN(, 1, IFERROR(REGEXEXTRACT(
 SPLIT(REGEXREPLACE(x&" ", "^(\w ) ", ), " "), "[A-Z]"))))))))

enter image description here

CodePudding user response:

So, took only two of your examples as I don't have time to type them all in, but this works:

LEFT(B1,FIND(" ",B1)-1)&" "&MID(B1,FIND(" ",B1,1) 1,1)&IFERROR(MID(B1,FIND(" ",B1,FIND(" ",B1,1) 1) 1,1),"")

enter image description here

I used mid() instead of your left(left( construct and find() to find the second and third spaces.

The iferror is to not have an error when the third name does not exist.

You can expand this for 4 names :) good luck.

  • Related