ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Extracting data from Excel (https://www.excelbanter.com/excel-worksheet-functions/241383-extracting-data-excel.html)

SMD

Extracting data from Excel
 
In column A2 I have this number 91-109002-000-A. In column G, I have several
109002 -000. I want to be able to compare A2 to all of G and if the
number is similar (what I call the base number), then I need for the formula
to look at column H and extract that information. So there may be more than
one answer for my extraction. Example:
(A) (G) (H)
Extraction would read
(2) 91-109002-000-A 109002-000 350574 350574,350575,643225
109002-000 350575
109002-000 643225

Don Guillett

Extracting data from Excel
 
Sub getpartialdata()
mn = "109002-000"
For Each c In Range("g1:g3")
If InStr(c, mn) Then
ms = ms & " " & c.Offset(, 1)
End If
Next
MsgBox ms
'range("i2")=ms'??
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"SMD" wrote in message
...
In column A2 I have this number 91-109002-000-A. In column G, I have
several
109002 -000. I want to be able to compare A2 to all of G and if the
number is similar (what I call the base number), then I need for the
formula
to look at column H and extract that information. So there may be more
than
one answer for my extraction. Example:
(A) (G) (H)
Extraction would read
(2) 91-109002-000-A 109002-000 350574
350574,350575,643225
109002-000 350575
109002-000 643225



SMD

Extracting data from Excel
 
Don, Thanks for your quick reply. Column A2 will have many more numbers. I
was hoping to use a formula.

"Don Guillett" wrote:

Sub getpartialdata()
mn = "109002-000"
For Each c In Range("g1:g3")
If InStr(c, mn) Then
ms = ms & " " & c.Offset(, 1)
End If
Next
MsgBox ms
'range("i2")=ms'??
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"SMD" wrote in message
...
In column A2 I have this number 91-109002-000-A. In column G, I have
several
109002 -000. I want to be able to compare A2 to all of G and if the
number is similar (what I call the base number), then I need for the
formula
to look at column H and extract that information. So there may be more
than
one answer for my extraction. Example:
(A) (G) (H)
Extraction would read
(2) 91-109002-000-A 109002-000 350574
350574,350575,643225
109002-000 350575
109002-000 643225




Don Guillett

Extracting data from Excel
 

If desired, send your file to my address below along with this msg and
a clear explanation of what you want and before/after examples.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"SMD" wrote in message
...
Don, Thanks for your quick reply. Column A2 will have many more numbers.
I
was hoping to use a formula.

"Don Guillett" wrote:

Sub getpartialdata()
mn = "109002-000"
For Each c In Range("g1:g3")
If InStr(c, mn) Then
ms = ms & " " & c.Offset(, 1)
End If
Next
MsgBox ms
'range("i2")=ms'??
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"SMD" wrote in message
...
In column A2 I have this number 91-109002-000-A. In column G, I have
several
109002 -000. I want to be able to compare A2 to all of G and if the
number is similar (what I call the base number), then I need for the
formula
to look at column H and extract that information. So there may be more
than
one answer for my extraction. Example:
(A) (G) (H)
Extraction would read
(2) 91-109002-000-A 109002-000 350574
350574,350575,643225
109002-000 350575
109002-000 643225






All times are GMT +1. The time now is 11:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com