what is best way to do this?

petethecat

Board Regular
Joined
Oct 25, 2011
Messages
63
I want to interrogate some data that is only available in a certain format & can change every day. The objective is to extract the data under the "header" so that ultimately i can use a VLOOKUP to get what i want from the data.

This is how it looks at present:
000Leg 4000
T2001A02500SF632V(1)MB76041013904
T2002A02500SF632V(1)MB76041013901
T2003A01200SF632V(1)MB76041013905
T2004A02500SF632V(1)MB76041013630
T2006A01200SF632V(2)MB76041013902
T2007A01200SF632V(2)MB76041013629
T2008A036000000
0000000
T204400SF632V(2)MB76041013625
000Leg 5000
0000000
T2002B00DF770E(1)VS62331013809
T20200DF770E(2)VS62331013810
A30000DF578E(1)JL59761013805
000DF578E(2)JL59761013806
000DF770E(1)VS62331014077
000DF770E(2)VS62331014078
000Leg 7000
T88000SF630VCM(1)VW63801013819
T88100SF630VCM(1)VW63811013817
T882000000
T88300SF630VCM(2)VW63811013818
T88400SF630VCM(2)VW63801013820
T88500SF630VCM(2)VW63811013816
T88600DW2114LB(1)LB61331014105

<colgroup><col span="5"><col><col span="3"></colgroup><tbody>
</tbody>

What i want to do is have a new column that identifies the area (LEG4, LEG5 LEG7 In bold/italics) and what ever is under that is called the heading. IE in a column next to T2001 I would want to have "LEG 4" shown. Same in T2002 Etc until we get to LEG5 where i would want to show LEG5 against T2002B & so on all the way down.

I have attempted If/AND but i come unstuck when we get further down the list as the statement does not cover all the scenarios.

This must be a simple thing to rectify but i cant for the life in me think what it is!

Any help is greatly appreciated.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Does this work for what you need?



Book1
ABCDEFG
1Leg 4Leg 4
2T2001ALeg 42500SF632V(1)MB76041013904
3T2002ALeg 42500SF632V(1)MB76041013901
4T2003ALeg 41200SF632V(1)MB76041013905
5T2004ALeg 42500SF632V(1)MB76041013630
6T2006ALeg 41200SF632V(2)MB76041013902
7T2007ALeg 41200SF632V(2)MB76041013629
8T2008ALeg 43600
9Leg 4
10T2044Leg 4SF632V(2)MB76041013625
11Leg 5Leg 5
12Leg 5
13T2002BLeg 5DF770E(1)VS62331013809
14T202Leg 5DF770E(2)VS62331013810
15A300Leg 5DF578E(1)JL59761013805
16Leg 5DF578E(2)JL59761013806
17Leg 5DF770E(1)VS62331014077
18Leg 5DF770E(2)VS62331014078
19Leg 7Leg 7
20T880Leg 7SF630VCM(1)VW63801013819
21T881Leg 7SF630VCM(1)VW63811013817
22T882Leg 7
23T883Leg 7SF630VCM(2)VW63811013818
24T884Leg 7SF630VCM(2)VW63801013820
25T885Leg 7SF630VCM(2)VW63811013816
26T886Leg 7DW2114LB(1)LB61331014105
Sheet1
Cell Formulas
RangeFormula
B1=IF(ISNUMBER(SEARCH("Leg",D1)),D1,OFFSET(D1,-1,-2))
 
Last edited:
Upvote 0
one question though. What would i need to change if i wanted to shift the column across to the left (2 columns - so a new column A) Where the data is shown in the example i cant use that column - Col B. I would need to insert a column, move everything over by one & use a new column A
 
Upvote 0
Assuming that you insert a new column as A and your heading column now becomes Column E - Enter into Cell A1;


=IF(ISNUMBER(SEARCH("Leg",E1)),E1,OFFSET(E1,-1,-4))
 
Upvote 0

Forum statistics

Threads
1,216,827
Messages
6,132,945
Members
449,770
Latest member
laptopdoritos

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