Guys help me find the most efficient way to retrieve and insert information. Macro or Formula?

Coyotex3

Active Member
Joined
Dec 12, 2021
Messages
496
Office Version
  1. 365
Platform
  1. Windows
Hello once again, hoping to get some help, and hoping I could explain things better for you guys.

I'm going to have a variable range such as the one below.

Book1
ABCDEFG
1Customer OrdersAddressPhone #Delivery Method
2John Doe's Order127 Go MrExcel123-456-7894Next Door Neighbor
3Jack Hanma's Order123 Send Help123-456-7890In person
4John Hanma's Order124 Please Help123-456-7891Front Door
5Joe Hanma's Order125 I Mean it123-456-7892Mailbox
6Jane Hanma's Oder126 You Rock123-456-7893In Person
7
8
9
10
11
12
13
14
Sheet1


On Sheet 2 I will have relevant order information such as the one below.

Book1
ABCD
1CustomerNumber
2Jack Hanma10001
3John Hanma20001
4Joe Hanma30001
5Jane Hanma40001
6John Doe50001
7Jack Doe60001
8Jane Doe70001
9Jose Doe80001
10
11
12
13
14
Sheet2


Now here is a simplified version of what I would like to accomplish.

Book1
ABCDEFGH
1Customer OrdersAddressPhone #Delivery MethodPrimary OrderSecondary OrderExtra Orders
2John Doe's Order127 Go MrExcel123-456-7894Next Door Neighbor500012500013500014
3Jack Hanma's Order123 Send Help123-456-7890In person100012100013100014
4John Hanma's Order124 Please Help123-456-7891Front Door200012200013200014
5Joe Hanma's Order125 I Mean it123-456-7892Mailbox300012300013300014
6Jane Hanma's Oder126 You Rock123-456-7893In Person400012400013400014
7
8
9
10
Sheet1


I'm going to have a larger customers list( 2-3k rows) and essentially I would like to find the most efficient way to get excel to look at "sheet2" find the match and insert extra columns such as above where the digit "2" was added to primary orders. Digit 3 was added to Secondary orders and Digit 4 was added to the extra orders.

Would you guys suggest a macro for this or should I be looking at some formulas. Any help in getting started would be helpful.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
To clarify, is seems as though you are trying to group all of the orders based on the name of the customer? If so, it seems like this is a task for Power Query. You would need to add the tables to the data model and while I haven't tried it, it seems as though you could pivot on the customer name and then add a custom function column that adds the extra digit. However, this would be the easiest and would not require any macros, and a simple formula of adding 1 for each column from the primary order, secondary order, etc.
 
Upvote 0
To clarify, is seems as though you are trying to group all of the orders based on the name of the customer? If so, it seems like this is a task for Power Query. You would need to add the tables to the data model and while I haven't tried it, it seems as though you could pivot on the customer name and then add a custom function column that adds the extra digit. However, this would be the easiest and would not require any macros, and a simple formula of adding 1 for each column from the primary order, secondary order, etc.
Thank you I will give this a try and see how it goes.
 
Upvote 0

Forum statistics

Threads
1,215,036
Messages
6,122,794
Members
449,095
Latest member
m_smith_solihull

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