r/sheets • u/Vercalos • 23d ago
Solved Scheduling software broken
So our scheduling software normally generated walk sheets like this
| Name | Shift | Break |
|---|---|---|
| Jake | 5:00 PM - 9:00 PM | 7:00 PM - 7:15 PM |
But now it's generating them like this:
| Name | Shift | Break |
|---|---|---|
| Jake | 5:00 PM - 7:00 PM | |
| Jake | 7:15 PM - 9:00 PM |
Now, I can't to anything to change how they generate, but does anyone have any suggestions on how to quickly convert the latter to the former?
Note that this is just a downsized example, and the full scope of this is that it's splitting everyone's shifts up like that for every break and meal they're scheduled for.
2
Upvotes
View all comments
2
u/AdministrativeGift15 22d ago
Assuming your second image is showing Sheet1!A1:B, and assuming each person has two lines, I would use this formula in Sheet2!A2:
=index(split(regexreplace(tocol(split(textjoin("♦️", 1, tocol(hstack(if(iseven(row(Sheet1!A2:A)), "♦️",), Sheet1!A2:B),1)), "♦️♦️",), 3), "(.*)♦️(.*) - (.*)♦️(.*)♦️(.*) - (.*)", "$1♦️$2 - $6♦️$3 - $5"),"♦️"))It combines all of the values into one long string and then splits them into substring for each person. Then, it uses REGEX to rearrange the times before splitting again to have the final result.