ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Excel to create codes using the 321 system (https://www.excelbanter.com/excel-worksheet-functions/25955-excel-create-codes-using-321-system.html)

Mirsten Choiple

Excel to create codes using the 321 system
 
I want to use Excel to create codes using the 321 system.

B1 contains a book title. (eg French Lieutenant's Woman, The).

A1 to have the first three letters of the first word, the first two letters
of the second word and the first letter of the third word. (eg FreLiW).



If somone could help me find a formula that will do this, I'd be very
grateful indeed.



DL




JE McGimpsey

One way:

=LEFT(TRIM(A1),3) & MID(Trim(A1), FIND(" ",TRIM(A1))+1,2) &
MID(TRIM(A1), FIND("^", SUBSTITUTE(TRIM(A1)," ", "^", 2))+1,1)

Note there's no error checking - if the cell contains less than three
words, it will return an error.


In article ,
"Mirsten Choiple" wrote:

I want to use Excel to create codes using the 321 system.

B1 contains a book title. (eg French Lieutenant's Woman, The).

A1 to have the first three letters of the first word, the first two letters
of the second word and the first letter of the third word. (eg FreLiW).



If somone could help me find a formula that will do this, I'd be very
grateful indeed.


Mirsten Choiple

Many thanks for your help.

In the case of a title with only two words (eg Madam Bovary).

The desired result would be (eg MadBo).

Is that a possibility?

DL



"JE McGimpsey" wrote in message
...
One way:

=LEFT(TRIM(A1),3) & MID(Trim(A1), FIND(" ",TRIM(A1))+1,2) &
MID(TRIM(A1), FIND("^", SUBSTITUTE(TRIM(A1)," ", "^", 2))+1,1)

Note there's no error checking - if the cell contains less than three
words, it will return an error.


In article ,
"Mirsten Choiple" wrote:

I want to use Excel to create codes using the 321 system.

B1 contains a book title. (eg French Lieutenant's Woman, The).

A1 to have the first three letters of the first word, the first two
letters
of the second word and the first letter of the third word. (eg FreLiW).



If somone could help me find a formula that will do this, I'd be very
grateful indeed.




JE McGimpsey

One way:

=LEFT(TRIM(A1),3)&IF(ISERR(FIND(" ",TRIM(A1))), "",
MID(TRIM(A1),FIND(" ", TRIM(A1))+1,2) &
IF((LEN(TRIM(A1))-LEN(SUBSTITUTE(A1," ","")))1, MID(TRIM(A1),
FIND("^",SUBSTITUTE(TRIM(A1)," ","^",2))+1,1),""))



In article ,
"Mirsten Choiple" wrote:

Many thanks for your help.

In the case of a title with only two words (eg Madam Bovary).

The desired result would be (eg MadBo).

Is that a possibility?



"JE McGimpsey" wrote in message
...
One way:

=LEFT(TRIM(A1),3) & MID(Trim(A1), FIND(" ",TRIM(A1))+1,2) &
MID(TRIM(A1), FIND("^", SUBSTITUTE(TRIM(A1)," ", "^", 2))+1,1)


Mirsten Choiple

Ten thousand thanks; it works beautifully.

DL



"JE McGimpsey" wrote in message
...
One way:

=LEFT(TRIM(A1),3)&IF(ISERR(FIND(" ",TRIM(A1))), "",
MID(TRIM(A1),FIND(" ", TRIM(A1))+1,2) &
IF((LEN(TRIM(A1))-LEN(SUBSTITUTE(A1," ","")))1, MID(TRIM(A1),
FIND("^",SUBSTITUTE(TRIM(A1)," ","^",2))+1,1),""))



In article ,
"Mirsten Choiple" wrote:

Many thanks for your help.

In the case of a title with only two words (eg Madam Bovary).

The desired result would be (eg MadBo).

Is that a possibility?



"JE McGimpsey" wrote in message
...
One way:

=LEFT(TRIM(A1),3) & MID(Trim(A1), FIND(" ",TRIM(A1))+1,2) &
MID(TRIM(A1), FIND("^", SUBSTITUTE(TRIM(A1)," ", "^", 2))+1,1)




Harlan Grove

JE McGimpsey wrote...
One way:

=LEFT(TRIM(A1),3)&IF(ISERR(FIND(" ",TRIM(A1))), "",
MID(TRIM(A1),FIND(" ", TRIM(A1))+1,2) &
IF((LEN(TRIM(A1))-LEN(SUBSTITUTE(A1," ","")))1, MID(TRIM(A1),
FIND("^",SUBSTITUTE(TRIM(A1)," ","^",2))+1,1),""))

....

And another (a little redundancy goes a long way, or should that be a
short way),

=TRIM(LEFT(TRIM(A1),3)&MID(TRIM(A1),FIND(" ",TRIM(A1)&" ")+1,2)
&MID(TRIM(A1),FIND(" ",SUBSTITUTE(TRIM(A1)," ","",1)&" ")+2,1))



All times are GMT +1. The time now is 07:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com