Question : two words from one cell split  to two cell's with one word ecel07

in sheet1 from B2 to B11 are cell's with two words , in sheet2  need first 7 letters of those words  to bi in separated cells from A23 to A32 for first and C23 to C32 for second word
1exampl (football teams ) :
                    B                                                            A            B          C
2  Liverpool v Chelsea                             23   Liverpo                Chelsea
sheet1                                                         sheet2

2exampl:
                                B                                                         A            B         C                                      
2   Newcastle United v Sunderland              23   Newcast              Sunderl
sheet1                                                                sheet2

3exampl:
                                B                                                         A            B           C      
2  Manchester United v Manchester City    23  MancheU                MancheC
sheet1                                                               sheet2
                                                                           (or   United                        City)    

4exampl:
                                B                                                           A            B           C    
2  Tottenham Hotspur v Portsmouth                23   Tottenh              Portsmo
sheet1                                                                    sheet2

is there formula or macro to deal with  this problem

Answer : two words from one cell split  to two cell's with one word ecel07

Hello thmh,

Logically if Manchester United should become "MancheU" then Newcastle United should become "NewcasU" but if you want it to be "Newcast" then I suggest you'll have to explicitly specify the "translation" for each team.

On the attached I used a lookup table, named Teamtable, to list all Premiership teams and the translations. You can change them as required. Note I left Fulham as "Fulham" which only has 6 letters, does it need to be 7? What would that be?

Then in Sheet2 A23 formula can be

=IF(Sheet1!B2="","",VLOOKUP(LEFT(Sheet1!B2,FIND(" v ",Sheet1!B2)-1),Teamtable,2,0))

and in C23

=IF(Sheet1!B2="","",VLOOKUP(TRIM(REPLACE(Sheet1!B2,1,FIND(" v ",Sheet1!B2)+2,"")),Teamtable,2,0))

Note: all games must include " v " otherwise the formula will fail, see attached

regards, barry

 
football
 
Random Solutions  
 
programming4us programming4us