hi guys...
I got this excel formula from jtakw and mackc557 .. and its working perfectly thank you guys ... Can anyone suggest a VBA code for this formulae.. Thank you
I got this excel formula from jtakw and mackc557 .. and its working perfectly thank you guys ... Can anyone suggest a VBA code for this formulae.. Thank you
Book1.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,850-C,850-D | |||||
4 | 50/8,6,2/5,1,4/5,5 | 50/8,6 | 2/5,1,4/5,5 | 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,6-8,1-9 | 1000-5-2,1000-6-8,1000-1-9 | |||||
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 | =IFERROR(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 | =IFERROR(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(SUBSTITUTE(TRIM(SUBSTITUTE(B2,",",","&LEFT(B2,FIND("/",B2)))&" "&IFERROR(SUBSTITUTE(D2,",",","&LEFT(D2,FIND("/",D2))),"")&IFERROR(" "&SUBSTITUTE(E2,",",","&LEFT(E2,FIND("/",E2))),""))," ",","),"/","-") |