Split data into two halves based on column values

Saved

New Member
Joined
Sep 28, 2012
Messages
17
I was looking for code that will automatically split data into equal halves and copy paste next to each other. The criteria is based on two columns-Date and Shift.

Eg.
A) 27/06/2024-Shift 1 has 422 rows, then Sl. 01-211 should be on the left and 212-422 should be on the right.
B) 27/06/2024-Shift 2 has 420 rows, then Sl .01-210 should be on the left and 211-420 should be on the right.

It should loop the same exercise for the remaining dates/shifts based on the number of rows for those. I have done it manually in the example, but it's a nightmare once there are many dates and shifts.
PS: Unable to use XL2BB to paste the data.
 

Attachments

  • Sample.jpg
    Sample.jpg
    188.1 KB · Views: 14

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Split data based on serial number and paste beside - OzGrid Free Excel/VBA Help Forum
There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,217
Members
453,024
Latest member
Wingit77

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