Hey Guys,
Would love some help with the below sheets. I want to duplicate the rows in the Input sheet based on the number of adults and childeren, columns C and D. For every duplicated row there needs to be an extra column showing "Adult" for every adult and "Child" for every child.
Input example
Output example
Would love some help with the below sheets. I want to duplicate the rows in the Input sheet based on the number of adults and childeren, columns C and D. For every duplicated row there needs to be an extra column showing "Adult" for every adult and "Child" for every child.
Input example
Example.xlsx | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | |||
1 | arrival | departure | children | adults | travel_purpose | nationality | date_of_birth | country | ||
2 | 1/21/24 | 1/26/24 | 0 | 2 | private_trip | CH | 7/12/90 | CH | ||
3 | 1/22/24 | 1/26/24 | 2 | 4 | private_trip | DE | 5/9/79 | CH | ||
4 | 1/22/24 | 1/27/24 | 0 | 1 | private_trip | CH | 11/2/90 | CH | ||
5 | 1/22/24 | 2/3/24 | 1 | 3 | private_trip | CH | 2/7/54 | CH | ||
6 | 1/22/24 | 1/24/24 | 0 | 1 | private_trip | CH | 3/20/94 | CH | ||
Input |
Output example
Example.xlsx | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | |||
1 | arrival | departure | children | adults | travel_purpose | nationality | date_of_birth | country | Class | ||
2 | 1/21/24 | 1/26/24 | 0 | 2 | private_trip | CH | 7/12/90 | CH | Adult | ||
3 | 1/21/24 | 1/26/24 | 0 | 2 | private_trip | CH | 7/12/90 | CH | Adult | ||
4 | 1/22/24 | 1/26/24 | 2 | 4 | private_trip | DE | 5/9/79 | CH | Adult | ||
5 | 1/22/24 | 1/26/24 | 2 | 4 | private_trip | DE | 5/9/79 | CH | Adult | ||
6 | 1/22/24 | 1/26/24 | 2 | 4 | private_trip | DE | 5/9/79 | CH | Adult | ||
7 | 1/22/24 | 1/26/24 | 2 | 4 | private_trip | DE | 5/9/79 | CH | Adult | ||
8 | 1/22/24 | 1/26/24 | 2 | 4 | private_trip | DE | 5/9/79 | CH | Child | ||
9 | 1/22/24 | 1/26/24 | 2 | 4 | private_trip | DE | 5/9/79 | CH | Child | ||
10 | 1/22/24 | 1/27/24 | 0 | 1 | private_trip | CH | 11/2/90 | CH | Adult | ||
11 | 1/22/24 | 2/3/24 | 1 | 3 | private_trip | CH | 2/7/54 | CH | Adult | ||
12 | 1/22/24 | 2/3/24 | 1 | 3 | private_trip | CH | 2/7/54 | CH | Adult | ||
13 | 1/22/24 | 2/3/24 | 1 | 3 | private_trip | CH | 2/7/54 | CH | Adult | ||
14 | 1/22/24 | 2/3/24 | 1 | 3 | private_trip | CH | 2/7/54 | CH | Child | ||
15 | 1/22/24 | 1/24/24 | 0 | 1 | private_trip | CH | 3/20/94 | CH | Adult | ||
Output |
Last edited by a moderator: