Using the Text function to derive a 4 letter word from 2 word

nav k 1 Reputation point
2021-03-01T21:57:52.873+00:00

So I have been given a task to using the text function to derive 4 letter words from sports names. For example, Tennis should be turned into TENN, and so on, however, I'm having difficulty with the two letter sports such as "American football". I have been asked to create a 4 letter word for it using a function as well however it should be the first three letters of the first word combined with the first letter of the second word, so American football would be "AMEF". I have figured out how to use the left function to get the codes for one word sports such as tennis, hockey and such but I don't know how to get the code for two letter words.

Microsoft 365 and Office Excel For business Windows
{count} votes

1 answer

Sort by: Most helpful
  1. Lz._ 9,016 Reputation points
    2021-03-02T01:35:02.047+00:00

    Hi @nav k

    73231-demo.png

    in B2:

    =UPPER(  
      IF(ISNUMBER(SEARCH(" ",A2)),  
        LEFT(A2,3) & MID(A2,SEARCH(" ",A2)+1,1),  
        LEFT(A2,4)  
      )  
    )  
    

    in C2 (if you run Excel 365 with the LET function):

    =LET(  
      SpacePos, SEARCH(" ",A2),  
      Code,     IF(ISNUMBER(SpacePos),  
                  LEFT(A2,3) & MID(A2,SpacePos+1,1),  
                  LEFT(A2,4)  
                ),  
      UPPER(Code)  
    )  
    
    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.