1 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

Split a row in two when a column has 2 values

Our take

If you're working with a dataset where a single column contains multiple values, splitting those values into separate rows can significantly enhance clarity and usability. For instance, in your example, you have names paired with time ranges, but some entries include multiple time slots. The goal is to create a cleaner format that lists each name with its corresponding time slots on separate rows. While you've experimented with functions like LET and arrays, let's explore a more straightforward approach to achieve this outcome efficiently.

So i'm puzzling with the following, hard to explain in a title, im sorry.

| COLUMN A | COLUMN B | | Name 1 | 01:00 - 02:00 | | Name 2 | 01:00 - 02:00 03:00 - 04:00 | | Name 3 | 01:00 - 02:00 |

The desired outcome:

| COLUMN C | COLUMN D | | Name 1 | 01:00 - 02:00 | | Name 2 | 01:00 - 02:00 | | Name 2 | 03:00 - 04:00 | | Name 3 | 01:00 - 02:00 |

I did mess around a bit with LET, making 2 arrays, stack them, then filter them.. but there must be a cleaner way. How would you approach this?

submitted by /u/danqplus
[link] [comments]

Read on the original site

Open the publisher's page for the full experience

View original article

Tagged with