Split Value

vijaychennai

Board Regular
Joined
Dec 7, 2009
Messages
239
Hello All,

good day. I have excel file in the below format.


Sheet Name :- Sheet1


QTYDataValueSolutionQTYDataValue
1TSKdesc11TSKdesc1
2ASDDESC2011ASDDESC201
1ASDFdes301ASDDESC201
1ASDFdes30

<tbody>
</tbody>
 
Last edited by a moderator:

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Try


A
B
C
D
E
F
G
1
QTY​
Data​
Value​
QTY​
Data​
Value​
2
1​
TSK​
desc1​
1​
TSK​
desc1​
3
2​
ASD​
DESC201​
1​
ASD​
DESC201​
4
1​
ASDF​
des30​
1​
ASD​
DESC201​
5
1​
ASDF​
des30​
6
7

Array formula in F2 copied down
=IF(ROWS(F$2:F2)>SUM(A$2:A$4),"",INDEX(B$2:B$4,IFERROR(1+MATCH(ROWS(F$2:F2)-1,SUBTOTAL(9,OFFSET(A$2,,,ROW(A$2:A$4)-ROW(A$2)+1))),1)))
confirmed with Ctrl+Shift+Enter, not just Enter

Formula in E2 copied down
=IF(F2<>"",1,"")

Formula in G2 copied down
=IF(F2="","",VLOOKUP(F2,B:C,2,0))

Hope this helps

M.
 
Upvote 0
Try:-
NB:- This code will alter your data. !!
Code:
[COLOR="Navy"]Sub[/COLOR] MG21Mar22
[COLOR="Navy"]Dim[/COLOR] Lst [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] n [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] Ac [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
Lst = Range("A" & Rows.Count).End(xlUp).Row
[COLOR="Navy"]For[/COLOR] n = Lst To 2 [COLOR="Navy"]Step[/COLOR] -1
    [COLOR="Navy"]If[/COLOR] Cells(n, 1) > 1 [COLOR="Navy"]Then[/COLOR]
        [COLOR="Navy"]For[/COLOR] Ac = 1 To Cells(n, 1) - 1
            Cells(n, 1) = 1
            Cells(n, 1).Resize(, 3).Copy
            Cells(n + Ac, 1).Insert shift:=xlDown
        [COLOR="Navy"]Next[/COLOR] Ac
    [COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]Next[/COLOR] n
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Last edited:
Upvote 0
You're welcome
NB:- You could try the code with the "Screenupdating" might improve the time !!!
Code:
[COLOR="Navy"]Sub[/COLOR] MG21Mar40
[COLOR="Navy"]Dim[/COLOR] Lst [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] n [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] Ac [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
Application.ScreenUpdating = False
Lst = Range("A" & Rows.Count).End(xlUp).Row
[COLOR="Navy"]For[/COLOR] n = Lst To 2 [COLOR="Navy"]Step[/COLOR] -1
    [COLOR="Navy"]If[/COLOR] Cells(n, 1) > 1 [COLOR="Navy"]Then[/COLOR]
        [COLOR="Navy"]For[/COLOR] Ac = 1 To Cells(n, 1) - 1
            Cells(n, 1) = 1
            Cells(n, 1).Resize(, 3).Copy
            Cells(n + Ac, 1).Insert shift:=xlDown
        [COLOR="Navy"]Next[/COLOR] Ac
    [COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]Next[/COLOR] n
Application.ScreenUpdating = True
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top