Auto fill group data using info from another worksheet? - Formula Needed.

BoldB

New Member
Joined
Apr 20, 2013
Messages
16
Microsoft Excel 2010, Windows 7


Hi all,

Looking for some help with a formula to auto fill data from one worksheet to another by using a formula:

On our first worksheet we have sales data with codes

The sales data is per a row and in that row is a code such as (A32) (C32) depending on product spec sold.

We want another 8 columns of associated data to be put in the next columns on the sales sheet.

I understand the data has to be referred to somewhere so on worksheet two we have all the codes listed down a column (eg Column A) and then next to it we have the next 8 columns with data relating to that code.

So how can we ask excel to copy the relevant data from the reference worksheet (worksheet 2) into our sales data (worksheet 1)

I was hoping at this stage for a formula based solution.

I know about scripts and macros BUT have NO experience, and need a quick fix solution at this point.

Also because of discrepancies in data, I believe a macro would need extra if but maybe rules to function correctly, where as a formula I can drag or copy down will work best for now, as I can adjust to suit the discrepancies in data.


For example, This is worksheet 1:

RECORDCODEGRABBED 1GRABBED 2GRABBED 3GRABBED 4GRABBED 5GRABBED 6GRABBED 7GRABBED 8
1C32
2D32
3E32
4F32
5C32
6D32
7I32
8J32
9K32
10L32
11M32
12F32
13J32
14K32

<tbody>
</tbody>

And this is worksheet 2

CODESGRAB 1GRAB 2GRAB 3GRAB 4GRAB 5GRAB 6GRAB 7GRAB 8
C3224x16£4.63£7.45654331.5
D3230x20£6.49£12.55785232
E3236x24£11.30£17.36936255
F3248x32£16.04£22.101258358
G3254x36£22.11£28.1714093512
H323 x 16x8£6.91£9.74432371.5
I323 x 24x12£10.76£16.83643272.5
J323 x 28x14£12.71£18.78743873.5
K323 x 40x20£19.90£25.961055277
L323 x 48x24£36.18£42.24125631520
M3232x18£8.39£11.22432291.5

<tbody>
</tbody>


On Worksheet 1, we want it to insert the cells next to the corresponding code in worksheet 2 into the next 8 columns (so CELL C2 on worksheet 1 would be auto filled with the data from CELL B2 as the code is "C32", CELL C5 in worksheet 1 would have the same date autofilled as the code is also "C32" etc..).

First post so I hope I've posted this correctly with enough information. Any help will be much appreciated.

Kind Regards
Steven
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
this is assuming that your spreadsheet codes starts in A1
=INDEX(Sheet2!$B$2:$I$12,MATCH($B2,Sheet2!$A$2:$A$12,0),MATCH(H$1,Sheet2!$B$1:$I$1,0))
you will also have to change the column headers so that they match
 
Upvote 0
RECORDCODEGRAB 1GRAB 2GRAB 3GRAB 4GRAB 5GRAB 6GRAB 7GRAB 8
1C3224x16£4.63£7.450654331.5
2D3230x20£6.49£12.550785232
3E3236x24£11.30£17.360936255
4F3248x32£16.04£22.1001258358
5C3224x16£4.63£7.450654331.5
6D3230x20£6.49£12.550785232
7I323 x 24x12£10.76£16.830643272.5
8J323 x 28x14£12.71£18.780743873.5
9K323 x 40x20£19.90£25.9601055277
10L323 x 48x24£36.18£42.240125631520
11M3232x18£8.39£11.220432291.5
12F3248x32£16.04£22.1001258358
13J323 x 28x14£12.71£18.780743873.5
14K323 x 40x20£19.90£25.9601055277

<colgroup><col width="64" span="10" style="width:48pt"> </colgroup><tbody>
</tbody>
 
Upvote 0
Hi jamtay317,

Thanks, that worked perfectly :)

Looks like you know your stuff so if you could help me with this formula, would be of great help:

Our sales codes are as follows depending on what we sell:

Z3053[P31](00A)
0643(R)-M32
BM4010[M32](06S)

<tbody>
</tbody>

Is there a formula that would give us the code at the start IE anything before the Square "[" or Rounded "(" bracket in a the cell next to it so we would end up with this:

Z3053[P31](00A)Z3053
0643(R)-M320643
BM4010[M32](06S)BM4010

<tbody>
</tbody>

Kind Regards
Steven
 
Upvote 0
Try

=IF(ISNUMBER(FIND("[",A1)),LEFT(A1,FIND("[",A1)-1),LEFT(A1,FIND("(",A1)-1))
 
Upvote 0
Hi,

Lastly (hopefully) can anybody help with this formula:

With the same data as last time:

Z3053[P31](00A)
0643(R)-M32
BM4010[M32](06S)
G4144[AA32](00A)

<colgroup><col><col></colgroup><tbody>
</tbody>

We require the code from the cells (P31, M32, AA32 etc..) to be placed in the cell next to it so we end up with this:

Z3053[P31](00A)
P31
0643(R)-M32M32
BM4010[M32](06S)M32
G4144[AA32](00A)AA32

<colgroup><col><col></colgroup><tbody>
</tbody>

The code is only ever after the "-" or within the "[]".

Kind Regards
Steven
 
Upvote 0
Try

=IF(ISNUMBER(FIND("[",A1)),MID(A1,FIND("[",A1)+1,FIND("]",A1)-FIND("[",A1)-1),RIGHT(A1,LEN(A1)-FIND("-",A1)))
 
Upvote 0

Forum statistics

Threads
1,215,771
Messages
6,126,796
Members
449,337
Latest member
BBV123

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