Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default VBA to pull information

I have been attempting to complete this all day yesterday, and I think this
situation would be best suited for VBA.

Here is a small subset of my data )B, C, E, F, G, K are columns in data)
B C E F G K
UWI Up Perf Lwer Perf Formation
2 420390281200 10426 10440 CAMPBELL
2 420390281200 10681 10869 LARSEN
1 420390281200 10424.5 10442 FRIO CAMPBELL
1 420390281200 10696 10176 UNKNOWN LARSEN
1 420390281200 11117.5 11120.5 UNKNOWN

I have a group of wells with the same UWI# but these came from two different
data sets. The 1 represents a data set and the 2 represents another data set,
I want to merge the formation names from data set 2 into the data set 1.

I only want to merge the formation names when the the "Up Perf" and "Lwer
Per" of data set 1 falls into the range of data set 2, and here is one of the
issues if the "Up Perf" and "Lwer Per" of data set 1 is + or - 3 ft I still
want to pull the formation name of data set 2 into data set 1.

The example above
2 420390281200 10426 10440 CAMPBELL
1 420390281200 10424.5 10442 FRIO CAMPBELL

Because 10424.5 and 10442 (FRIO) is within the 10426 and 10440 (CAMPBELL)
+-3ft it is still returning CAMPBELL.

2 420390281200 10681 10869 LARSEN
1 420390281200 10696 10176 UNKNOWN LARSEN

Because 10696 and 10176 (UNKOWN) is between 10681 and 10869 (LARSEN) I need
is to return LARSEN.

2 420390281200 10426 10440 CAMPBELL
2 420390281200 10681 10869 LARSEN
1 420390281200 11117.5 11120.5 UNKNOWN

Because 11117.5 and 11120.5 does not fall into any of the data set 2 range
nothing needs to happen.

I appreciate any help.

All the formation names that are trying to be merged from data set should
populate on the data set 1 rows. If at all possible I would like the results
to return in column K.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default VBA to pull information

Try sorting on Key 1 = column F ascending and Key 2 column B descending

"James" wrote:

I have been attempting to complete this all day yesterday, and I think this
situation would be best suited for VBA.

Here is a small subset of my data )B, C, E, F, G, K are columns in data)
B C E F G K
UWI Up Perf Lwer Perf Formation
2 420390281200 10426 10440 CAMPBELL
2 420390281200 10681 10869 LARSEN
1 420390281200 10424.5 10442 FRIO CAMPBELL
1 420390281200 10696 10176 UNKNOWN LARSEN
1 420390281200 11117.5 11120.5 UNKNOWN

I have a group of wells with the same UWI# but these came from two different
data sets. The 1 represents a data set and the 2 represents another data set,
I want to merge the formation names from data set 2 into the data set 1.

I only want to merge the formation names when the the "Up Perf" and "Lwer
Per" of data set 1 falls into the range of data set 2, and here is one of the
issues if the "Up Perf" and "Lwer Per" of data set 1 is + or - 3 ft I still
want to pull the formation name of data set 2 into data set 1.

The example above
2 420390281200 10426 10440 CAMPBELL
1 420390281200 10424.5 10442 FRIO CAMPBELL

Because 10424.5 and 10442 (FRIO) is within the 10426 and 10440 (CAMPBELL)
+-3ft it is still returning CAMPBELL.

2 420390281200 10681 10869 LARSEN
1 420390281200 10696 10176 UNKNOWN LARSEN

Because 10696 and 10176 (UNKOWN) is between 10681 and 10869 (LARSEN) I need
is to return LARSEN.

2 420390281200 10426 10440 CAMPBELL
2 420390281200 10681 10869 LARSEN
1 420390281200 11117.5 11120.5 UNKNOWN

Because 11117.5 and 11120.5 does not fall into any of the data set 2 range
nothing needs to happen.

I appreciate any help.

All the formation names that are trying to be merged from data set should
populate on the data set 1 rows. If at all possible I would like the results
to return in column K.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default VBA to pull information

unfortunately I do not think that will work because it will than seperate the
UWI.
B C E F G K
2 420390281200 10426 10440 CAMPBELL
2 420390281200 10681 10869 LARSEN
1 420390281200 10424.5 10442 FRIO CAMPBELL
1 420390281200 10696 10176 UNKNOWN LARSEN
1 420390281200 11117.5 11120.5 UNKNOWN
2 420390282800 8859 8886 F-4
1 420390282800 8868 8881 FRIO F-4
2 420390282800 9786 9882 ARMSTRONG
2 420390282800 10002 10437 LARSEN
1 420390282800 10004 10430 UNKOWN LARSEN

I added a bit more of my data, you will see that there are two unique UWI
values 420390281200 and 420390282800 if I sort on column F than column B it
will mix all the UWIs together. That is why I have to sort first on UWI.
Like last time column k is what I would like for it to return.

Thanks again.

"Joel" wrote:

Try sorting on Key 1 = column F ascending and Key 2 column B descending

"James" wrote:

I have been attempting to complete this all day yesterday, and I think this
situation would be best suited for VBA.

Here is a small subset of my data )B, C, E, F, G, K are columns in data)
B C E F G K
UWI Up Perf Lwer Perf Formation
2 420390281200 10426 10440 CAMPBELL
2 420390281200 10681 10869 LARSEN
1 420390281200 10424.5 10442 FRIO CAMPBELL
1 420390281200 10696 10176 UNKNOWN LARSEN
1 420390281200 11117.5 11120.5 UNKNOWN

I have a group of wells with the same UWI# but these came from two different
data sets. The 1 represents a data set and the 2 represents another data set,
I want to merge the formation names from data set 2 into the data set 1.

I only want to merge the formation names when the the "Up Perf" and "Lwer
Per" of data set 1 falls into the range of data set 2, and here is one of the
issues if the "Up Perf" and "Lwer Per" of data set 1 is + or - 3 ft I still
want to pull the formation name of data set 2 into data set 1.

The example above
2 420390281200 10426 10440 CAMPBELL
1 420390281200 10424.5 10442 FRIO CAMPBELL

Because 10424.5 and 10442 (FRIO) is within the 10426 and 10440 (CAMPBELL)
+-3ft it is still returning CAMPBELL.

2 420390281200 10681 10869 LARSEN
1 420390281200 10696 10176 UNKNOWN LARSEN

Because 10696 and 10176 (UNKOWN) is between 10681 and 10869 (LARSEN) I need
is to return LARSEN.

2 420390281200 10426 10440 CAMPBELL
2 420390281200 10681 10869 LARSEN
1 420390281200 11117.5 11120.5 UNKNOWN

Because 11117.5 and 11120.5 does not fall into any of the data set 2 range
nothing needs to happen.

I appreciate any help.

All the formation names that are trying to be merged from data set should
populate on the data set 1 rows. If at all possible I would like the results
to return in column K.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default VBA to pull information

Your data only showed 1 UWI.

Then Try sorting on Key 1 = Column A ascending, Key 2 = column F ascending,
and Key 3 column B descending


"James" wrote:

unfortunately I do not think that will work because it will than seperate the
UWI.
B C E F G K
2 420390281200 10426 10440 CAMPBELL
2 420390281200 10681 10869 LARSEN
1 420390281200 10424.5 10442 FRIO CAMPBELL
1 420390281200 10696 10176 UNKNOWN LARSEN
1 420390281200 11117.5 11120.5 UNKNOWN
2 420390282800 8859 8886 F-4
1 420390282800 8868 8881 FRIO F-4
2 420390282800 9786 9882 ARMSTRONG
2 420390282800 10002 10437 LARSEN
1 420390282800 10004 10430 UNKOWN LARSEN

I added a bit more of my data, you will see that there are two unique UWI
values 420390281200 and 420390282800 if I sort on column F than column B it
will mix all the UWIs together. That is why I have to sort first on UWI.
Like last time column k is what I would like for it to return.

Thanks again.

"Joel" wrote:

Try sorting on Key 1 = column F ascending and Key 2 column B descending

"James" wrote:

I have been attempting to complete this all day yesterday, and I think this
situation would be best suited for VBA.

Here is a small subset of my data )B, C, E, F, G, K are columns in data)
B C E F G K
UWI Up Perf Lwer Perf Formation
2 420390281200 10426 10440 CAMPBELL
2 420390281200 10681 10869 LARSEN
1 420390281200 10424.5 10442 FRIO CAMPBELL
1 420390281200 10696 10176 UNKNOWN LARSEN
1 420390281200 11117.5 11120.5 UNKNOWN

I have a group of wells with the same UWI# but these came from two different
data sets. The 1 represents a data set and the 2 represents another data set,
I want to merge the formation names from data set 2 into the data set 1.

I only want to merge the formation names when the the "Up Perf" and "Lwer
Per" of data set 1 falls into the range of data set 2, and here is one of the
issues if the "Up Perf" and "Lwer Per" of data set 1 is + or - 3 ft I still
want to pull the formation name of data set 2 into data set 1.

The example above
2 420390281200 10426 10440 CAMPBELL
1 420390281200 10424.5 10442 FRIO CAMPBELL

Because 10424.5 and 10442 (FRIO) is within the 10426 and 10440 (CAMPBELL)
+-3ft it is still returning CAMPBELL.

2 420390281200 10681 10869 LARSEN
1 420390281200 10696 10176 UNKNOWN LARSEN

Because 10696 and 10176 (UNKOWN) is between 10681 and 10869 (LARSEN) I need
is to return LARSEN.

2 420390281200 10426 10440 CAMPBELL
2 420390281200 10681 10869 LARSEN
1 420390281200 11117.5 11120.5 UNKNOWN

Because 11117.5 and 11120.5 does not fall into any of the data set 2 range
nothing needs to happen.

I appreciate any help.

All the formation names that are trying to be merged from data set should
populate on the data set 1 rows. If at all possible I would like the results
to return in column K.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pull Information from one sheet to another Christina Excel Worksheet Functions 1 December 3rd 08 07:24 PM
Can Excel pull live information from the Web??? Hamed parhizkar Excel Programming 1 March 10th 08 04:10 AM
HOW CAN I PULL INFORMATION FROM ONE SHEET TO ANOTHER IF NOT # K Excel Worksheet Functions 4 June 8th 06 07:53 AM
Pull information from one worksheet to another Debbie Excel Discussion (Misc queries) 5 October 7th 05 02:16 PM
How do I pull information from one worksheet to another using cer. JeAnFrLe Excel Worksheet Functions 1 April 1st 05 07:18 AM


All times are GMT +1. The time now is 08:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"