Hi mjpalma,
If you know the web site then you could use a VLOOKUP
Cheers
Dave
Main Topics
Browse All TopicsI have two similar problems. The situation is I have a a web query that returns data to a blank worksheet, but data is returned to different places on the worksheet, usually within the same column, but at different rows. This problem is due to the web page and if it has an advertisement, this occurs randomly so there is no way to use an absolute reference to the needed data points. There is nothing I can do about this, and since of the data is returned by the query in pairs, one cell is a label and an adjacent cell is a data point, so as a solution I am using a index/match formula to find the data points I need. But there are two exceptions that I need help dealing with:
1- one data point is a cell that contains the following text "web site: " and then a URL. Since there is no adjacent cell I can use, and because its row may vary, I have been trying to find a function/formula that could find the specific cell with the "web site:" text and then return all the text for the cell, including the URL. Then I can use MID function to extract the URL
2- There are several instances where the label is in a cell on one row and the data point is on another row in the same column. The HLOOKUP function does not seem to work becuase the row of the label varies.
Any help would be much appreciated.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi,
For your first problem you could use:
=SUBSTITUTE(OFFSET(A1,MATC
Where the data comes in anywhere in the range A1:A16 and the leading text is "Web Site: ". The above function actually does both of the things you want to do - it finds the cell and extracts the url all in one formula.
Fro your second problem:
Your problem here is not clear - are you trying to return the URL as in the previous case? Is the URL in a cell by itselft? When you say "data point" what do you mean?
Shane Devenshire
sorry, I started posting to this one and then I stopped part way through when I saw Brad's answer. I must have hit submit when closing the window
My first suggestion was VLOOKUP which was included
The second part which I hadn't added was using a find routine, my example used SUMPRODUCT to avoid using an array formula
=MAX(IF(NOT(ISERROR(SEARCH
which assumes there is only 1 valid match to be found
but Shane's wildcard MATCH is a better approach
Cheers
Dave
Hi again,
If you just want the locatin of the item use only the portion of my suggestion that reads:
MATCH("Web Site:*",A1:A16,0)
If you just want to return the contents of that entry then use just this part:
OFFSET(A1,MATCH("Web Site:*",A1:A16,0)-1,0)
But if you want to return the URL from the cell without have separate formulas then use the whole thing, it saves you doing a MID function although you could do that also:
=SUBSTITUTE(OFFSET(A1,MATC
=MID(OFFSET(A1,MATCH("Web Site:*",A1:A16,0)-1,0),11,
The "11" argument will depend on how long the leading text in front of the URL is. The "200" is just a large enough number to catch any length url.
Shane Devenshire
All, thanks for the fast responses, I used Shane's
=SUBSTITUTE(OFFSET(A1,MATC
For the second problem let me rephrase it, since there was some confusion:
where ? = row number,
Where ? can vary from row 7 to 12 so far (it may vary in a wider range but I have not seen that yet)
Starting in cell A?- there is a table of 7 rows and 9 columns that I am trying to retrieve
Here is an example, "Company" is located in cell A?
A? B? C? D? E? F? G? H? I?
Company Symbol Price Change Market Cap P/E
Automatic Data Processing Inc ADP 44.75 1.40% 26.07B 28.11
Accenture Ltd ACN 25.13 1.99% 23.29B 20.65
Paychex Inc PAYX 33.31 1.65% 12.60B 40.72
Moody's Corp MCO 79.8 0.03% 11.79B 32.16
Reuters Group PLC RTRSY 41.19 1.01% 9.83B 15.95
Gartner Group Inc IT 11.69 0.09% 1.57B 83.5
Columns b,c,d are empty
the header row, starting with "Company" is always present, so if I can use that row for a reference point, what I need is a formula that searches for the cell with the header text and then reurns the approriate cell below the reference cell.
HLookup did not work because the row numbers may change, the same with offset so far. I tried nexting both within an index and a match function formula, neither worked.
Again thanks for the quick response and I am grateful for the help
So out of the sample data which item do you want to find? Please give us a specific example of the desired return value using the sample data you posted.
For example I want to find Moody's Corp's P/E ----> 32.16
Let's assume that is what you want to do, then enter the Company you want in cell A1 and the Item you want in cell B1, in C1 enter the formula:
=OFFSET(A6,MATCH(A1,A7:A12
Shane Devenshire
Sure, an example is I want to find the third company name in the list. I know that "Company" will always be returned by the query, the list of companies will change based on which web page I query. So, in this case, Paychex Inc is the third company. If I query a different web page, the third company on this list may be Ford. So I cannot just look for ford.
At the same time, the header row will change, so I need a formula that will find the right cells anywhere on the work sheet. I tried your formula above and it did not work, I think because there it needs a definite starting point.
So what I need for the formula to do is search column A for "Company", and then return the name of the third company on the list, "Paychex Inc." in this case, located 3 rows below which ever row "Company" is located.
thanks
Jim, I am having problems with your formula, its returning a value from further down column A than Paychex. Specifically, "Company" is currently located in row 36 (keeping in mind this will change depending on the website being queried), the formula is returning the value for row 78. Could the problem be related to the reference value "A1"?
Thanks for your help and patience
Mike
Mike,
In a multi-part question with input from a number of experts, it is common to split the points among several different experts. If you look at the top of the Comment box, there is a link for "Split Points". If you wouldn't mind, I am going to reopen the question so you can try this feature out.
byundt--Excel TA Page Editor
Business Accounts
Answer for Membership
by: byundtPosted on 2004-11-05 at 21:58:33ID: 12511698
Hi mjpalma, ROR(SEARCH ("web site:",D1:D500))),ROW(D1:D 500),"")), 1) Array formula, so hold the Control + Shift keys down while pressing Enter. Excel should respond by adding curly braces { } surrounding the formula.
For question number 1, consider using an array formula like this:
=INDEX(D:D,MIN(IF(NOT(ISER
This formula is case insensitive, and will return the entire contents of the first cell in column D containing the text "web site:"
Cheers!
Brad