This is my queation to be cleared
I got some formula that a friend from here has given me below, But it needs some modifications to get the above answer
Thank you
Book1.xlsx | ||||
---|---|---|---|---|
A | B | |||
1 | Question | Answer Should Be | ||
2 | 1/1,2,3,2/A,B,C | 1-1,1-2,1-3,2-A,2-B,2-C | ||
3 | 850/A-B,C,D | 850-A-B,850-C,850-D | ||
4 | 50/8,6,2/5,1,4/5,5 | 50-8,50-6,2-5,2-1,4-5,4-5 | ||
5 | 1000/5-2,6-8,1-9 | 1000-5-2,1000-6-8,1000-1-9 | ||
Sheet1 |
I got some formula that a friend from here has given me below, But it needs some modifications to get the above answer
1-1,2,3,5-1,2,3 to 1-1,1-2,1-3,5-1,5-2,5-3.xlsx | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
1 | Question | Answer | ||||||
2 | 1-1,2,3,2-A,B,C | 1-1,2,3 | 2-A,B,C | 2-A,B,C | 1-1,1-2,1-3,2-A,2-B,2-C | |||
3 | 850-A,B,C,D | 850-A,B,C,D | 850-A,B,C,D | 850-A,850-B,850-C,850-D | ||||
4 | 50-8,6,2,2-5,1,4-5,5 | 50-8,6,2 | 2-5,1,4-5,5 | 2-5,1 | 4-5,5 | 50-8,50-6,50-2,2-5,2-1,4-5,4-5 | ||
5 | 1000-5,2,6 | 1000-5,2,6 | 1000-5,2,6 | 1000-5,1000-2,1000-6 | ||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B2:B5 | B2 | =TRIM(LEFT(SUBSTITUTE(A2,",",IF(ISNUMBER(FIND("-",A2,FIND("-",A2)+1)),REPT(" ",100),","),LEN(LEFT(A2,FIND("-",A2&"-",FIND("-",A2)+1)))-LEN(SUBSTITUTE(LEFT(A2,FIND("-",A2&"-",FIND("-",A2)+1)),",",""))),100)) |
C2:C5 | C2 | =SUBSTITUTE(A2,TRIM(LEFT(SUBSTITUTE(A2,",",IF(ISNUMBER(FIND("-",A2,FIND("-",A2)+1)),REPT(" ",100),","),LEN(LEFT(A2,FIND("-",A2&"-",FIND("-",A2)+1)))-LEN(SUBSTITUTE(LEFT(A2,FIND("-",A2&"-",FIND("-",A2)+1)),",",""))),100))&",","") |
D2:D5 | D2 | =SUBSTITUTE(TRIM(LEFT(SUBSTITUTE(C2,",",IF(ISNUMBER(FIND("-",C2,FIND("-",C2)+1)),REPT(" ",100),","),LEN(LEFT(C2,FIND("-",C2&"-",FIND("-",C2)+1)))-LEN(SUBSTITUTE(LEFT(C2,FIND("-",C2&"-",FIND("-",C2)+1)),",",""))),100)),B2,"") |
E2:E5 | E2 | =IF(D2="","",MID(SUBSTITUTE(SUBSTITUTE(A2,B2&",",""),D2,""),2,99)) |
F2:F5 | F2 | =SUBSTITUTE(TRIM(SUBSTITUTE(B2,",",","&LEFT(B2,FIND("-",B2)))&" "&IFERROR(SUBSTITUTE(D2,",",","&LEFT(D2,FIND("-",D2))),"")&IFERROR(" "&SUBSTITUTE(E2,",",","&LEFT(E2,FIND("-",E2))),""))," ",",") |
Thank you