If one cell in a column has the desired data, then mark the cell x rows below it

inosent

Board Regular
Joined
Mar 19, 2007
Messages
131
I have a large text file I want to extract the email headers from. Every email is different, and there is no standardized way the data is organized. Let's say headers run for 2 -10 rows but they are all random and all different

Let's say the largest sized header is 10 lines

Each email has a specific marker that indicates the start of the header. Lets say that is "ABC"

What I am looking for is a formula to detect the last instance occurring of ABC and then at exactly 10 rows lower mark the 'end' of the header.

For example, here is what the result would look like, a formula that marks the 10th row below the last occurrence of ABC:

---A-----------|--B----
1- ABC--------|
2- header text-|
3- header text-|
4- header text-|
5- header text-|
6- header text-|
7- header text-|
8- body text---|
9- body text---|
10 body text---|END
11 body text---|
12 body text---|
13 body text---|
14 body text---|
15 body text---|
35 ABC--------|
36 header text-|
37 header text-|
38 header text-|
39 header text-|
40 header text-|
41 body text---|
42 body text---|
43 body text---|
44 body text---|
45 body text---|END
46 body text---|
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Sorry for posting. I found the solution. Lame question. Tried to delete but too late it seems
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,633
Latest member
DougMo

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