Trying to Separate multiple products within the same line automatically

alleneure

New Member
Joined
Feb 22, 2023
Messages
22
Office Version
  1. 365
Platform
  1. Windows
I am trying to separate claim data in a wooksheet similar to the table below.
Claim #Customer DataTire 1Serial #1Refund 1Tire 2Serial #2Refund 2Tire 3Serial #3Refund 3
W0001Jane Doe225P3RTY$ 100.00225P4RTY150225P5RTY200

I would like to take the data above and turn it into the table below preferably with formulas but I know I may have to resort to macros.

Claim # Customer Data Tire Serial Refund
W0001Jane Doe225P3RTY $ 100.00
W0001Jane Doe225P4RTY $ 150.00
W0001Jane Doe225P5RTY $ 200.00

Right now I have a sheet with a table with the data from the top table and I have a converter sheet to make the below table format and then I copy and paste the ew format into another table.
Is there another way to do this to update this automatically with formulas? Sometimes the claim will only have one or two tires not the full three.
 
Last edited:

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Hello, the following should work for the example but the question is whether it covers all of what is needed:

Excel Formula:
=LET(
a,WRAPROWS(TOCOL(C2:K2,1),3),
b,IF(SEQUENCE(ROWS(a)),A2:B2),
c,HSTACK(A1:B1,TEXTBEFORE(C1:E1," ")),
VSTACK(c,HSTACK(b,a)))
 
Upvote 0
Try:
Book1
ABCDEFGHIJK
1Claim #Customer DataTire 1Serial #1Refund 1Tire 2Serial #2Refund 2Tire 3Serial #3Refund 3
2W0001Jane Doe225P3RTY100225P4RTY150225P5RTY200
3W0002John Smith400P6RTY100500P7RTY150
4
5Claim #Customer DataTireSerialRefund
6W0001Jane Doe225P3RTY100
7W0001Jane Doe225P4RTY150
8W0001Jane Doe225P5RTY200
9W0002John Smith400P6RTY100
10W0002John Smith500P7RTY150
Sheet1
Cell Formulas
RangeFormula
A6:E10A6=LET(h,HSTACK(TOCOL(IFS(A2:A3>=SEQUENCE(,3),A2:A3),2),TOCOL(IFS(B2:B3>=SEQUENCE(,3),B2:B3),2),WRAPROWS(TOROW(C2:K3),3)),FILTER(h,CHOOSECOLS(h,5)<>0))
Dynamic array formulas.
 
Upvote 1
Solution
Hello, the following should work for the example but the question is whether it covers all of what is needed:

Excel Formula:
=LET(
a,WRAPROWS(TOCOL(C2:K2,1),3),
b,IF(SEQUENCE(ROWS(a)),A2:B2),
c,HSTACK(A1:B1,TEXTBEFORE(C1:E1," ")),
VSTACK(c,HSTACK(b,a)))
This looks like its almost there! Any way you could provide a little more insight into the logic behind it?
 
Upvote 0
Try:
Book1
ABCDEFGHIJK
1Claim #Customer DataTire 1Serial #1Refund 1Tire 2Serial #2Refund 2Tire 3Serial #3Refund 3
2W0001Jane Doe225P3RTY100225P4RTY150225P5RTY200
3W0002John Smith400P6RTY100500P7RTY150
4
5Claim #Customer DataTireSerialRefund
6W0001Jane Doe225P3RTY100
7W0001Jane Doe225P4RTY150
8W0001Jane Doe225P5RTY200
9W0002John Smith400P6RTY100
10W0002John Smith500P7RTY150
Sheet1
Cell Formulas
RangeFormula
A6:E10A6=LET(h,HSTACK(TOCOL(IFS(A2:A3>=SEQUENCE(,3),A2:A3),2),TOCOL(IFS(B2:B3>=SEQUENCE(,3),B2:B3),2),WRAPROWS(TOROW(C2:K3),3)),FILTER(h,CHOOSECOLS(h,5)<>0))
Dynamic array formulas.

Any way you could provide a little more insight into the logic behind it?
 
Upvote 0
Hello, the following should work for the example but the question is whether it covers all of what is needed:

Excel Formula:
=LET(
a,WRAPROWS(TOCOL(C2:K2,1),3),
b,IF(SEQUENCE(ROWS(a)),A2:B2),
c,HSTACK(A1:B1,TEXTBEFORE(C1:E1," ")),
VSTACK(c,HSTACK(b,a)))
When implementing this the tires are good but the specific claim and customer number just populate once as shown in the table below.


Claim NumberCustomer DataTireSerialRefend
W0001Jane Doe255P3RTY100
W0002John Smith225P4RTY150
#N/A#N/A255P5RTY200
#N/A#N/A256P6RTY101
#N/A#N/A225P7RTY151

Source Data:
Claim NumberCustomer DataTire 1Serial 1Refend 1Tire 2Serial 2Refend 2Tire 3Serial 3Refend 3
W0001Jane Doe255P3RTY100225P4RTY150255P5RTY200
W0002John Smith256P6RTY101225P7RTY151
 
Upvote 0
Try:
Book1
ABCDEFGHIJK
1Claim #Customer DataTire 1Serial #1Refund 1Tire 2Serial #2Refund 2Tire 3Serial #3Refund 3
2W0001Jane Doe225P3RTY100225P4RTY150225P5RTY200
3W0002John Smith400P6RTY100500P7RTY150
4
5Claim #Customer DataTireSerialRefund
6W0001Jane Doe225P3RTY100
7W0001Jane Doe225P4RTY150
8W0001Jane Doe225P5RTY200
9W0002John Smith400P6RTY100
10W0002John Smith500P7RTY150
Sheet1
Cell Formulas
RangeFormula
A6:E10A6=LET(h,HSTACK(TOCOL(IFS(A2:A3>=SEQUENCE(,3),A2:A3),2),TOCOL(IFS(B2:B3>=SEQUENCE(,3),B2:B3),2),WRAPROWS(TOROW(C2:K3),3)),FILTER(h,CHOOSECOLS(h,5)<>0))
Dynamic array formulas.
Once the logic was understood I easily modified this to work with my full data set! Thank you!
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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