Vlookup or?

TrinaT

New Member
Joined
Mar 23, 2022
Messages
14
Office Version
  1. 365
Platform
  1. MacOS
I have a spreadsheet of data that is coming from an event registration software. Along with event registrations, people are able to purchase products. Unfortunately the data export pulls the product sales out in different columns (not the same column for each product), and displays in random order. It also pulls through blank columns randomly.

I'm trying to pull the data into a useable order so I can easily decipher who has ordered what, and pull out overall order quantities for the final orders.

I'm not even sure if this can be done. I've attached an image of how the data pulls out.
Screen Shot 2022-03-23 at 12.27.48 pm.png
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
To rearrange the original data as in post #9 (no collating of similar people and/or items ordered) you could also consider this macro approach.

VBA Code:
Sub Rearrange()
  Dim a As Variant, b As Variant
  Dim i As Long, j As Long, k As Long, uba2 As Long
 
  a = Range("A1").CurrentRegion.Value
  uba2 = UBound(a, 2)
  ReDim b(1 To Rows.Count, 1 To 5)
  For i = 2 To UBound(a)
    For j = 3 To uba2 Step 3
      If Len(a(i, j)) > 0 Then
        k = k + 1
        b(k, 1) = a(i, 1): b(k, 2) = a(i, 2): b(k, 3) = a(i, j): b(k, 4) = a(i, j + 1): b(k, 5) = a(i, j + 2)
      End If
    Next j
  Next i
  Application.ScreenUpdating = False
  With Range("A" & UBound(a) + 4).Resize(k, 5)
    .Value = b
    .Rows(0).Value = Array("First Name", "Last Name", "Item", "Cost", "Qty")
  End With
  Application.ScreenUpdating = True
End Sub

So for original data as in rows 1:4 below, the code has produced the values in row 7 onwards.

TrinaT.xlsm
ABCDEFGHIJKLMNOPQRSTUVW
1First NameLast NameItem 1CostQtyItem 2CostQtyItem 3CostQtyItem 4Cost QtyItem 5Cost QtyItem 6Cost QtyItem 7Cost Qty
2JoeBlogsCooler101Shirt601Shirt 21203
3BarryEnglishBag301
4DanaDrinkCooler202Shirt601Shirt 2401
5
6
7First NameLast NameItemCostQty
8JoeBlogsCooler101
9JoeBlogsShirt601
10JoeBlogsShirt 21203
11BarryEnglishBag301
12DanaDrinkCooler202
13DanaDrinkShirt601
14DanaDrinkShirt 2401
Rearrange
Thanks Guys, I used Alex's PQ and that has worked. If I then wanted to pull the cleaned info into a table (qty ordered next to each person) what would the best formula be to use?

Sample Data.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZ
1First NameLast NameItemCostQty
2JohnDoeCooler Bag101
3JohnDoeT-Shirt - Ladies (V-Neck)401
4JohnDoeT-Shirt - Mens401
5JohnDoeEvent - Adult Registration1651
6DaisyDukeShirt - Long Sleeve601
7DaisyDukeT-Shirt - Mens401
8DaisyDukeEvent - Adult Registration1651
9DaisyDukeEvent) - Child Registration (under 12 years old)1001
10BarryManiloCooler Bag101
11BarryManiloShirt - Long Sleeve601
12BarryManiloT-Shirt - Mens401
13BarryManiloEvent - Adult Registration1651
14MarkJonesEvent - Adult Registration1651
15AdamAntCooler Bag101
16AdamAntShirt - Long Sleeve601
17AdamAntT-Shirt - Ladies (V-Neck)401
18AdamAntEvent - Adult Registration1651
19
20
21
22
23First NameLast Name Registrations Adult Registrations Child T-Shirt MensQtyColourSizeT-Shirt - Ladies (V-Neck)QtyColourSizeShirt - Long SleeveQtyColourSizeHooded SweatQtyColourSizeMascotQtyCooler BagQtyBar RunnerQty
24
25
26
27
Data Sheet
 
Upvote 0
Its not really clear what you mean, are you saying there is a second data extract ?
It that what you are showing at row 23 ? Can you provide some sample data ?
What is the link between the first table and the 2nd table eg first table has First/Last Name & Product as the lowest possible combination to link on ?

Can you show us what you expect the output to look like using the sample data you provide ?
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

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