Formula: Find text in range, return value

gger

New Member
Joined
Jan 5, 2011
Messages
25
Hi Guys,

I've got a web query from reuters (modified using vba to return financial ratios for a ticker within a specified cell) that is acting a bit wonky and i can't seem to fix it.

i enter a ticker in to a cell and press a button that runs a bunch of web queries. when i get to the query that returns financial ratios from reuters it will return the data but place it in different cells every time. i think this is because the data i 'checked-off' when i ran the query adds data when it is available, and leaves data out when it isn't available. so i guess another way of saying this is that instead of returning 20 rows of data every time, it returns 18 some times, and 20 others.

This is OK with me - what isn't OK is placing it in different cells every time. i want to be able to, on another sheet, link to these cells but because the query doesn't drop the data in the same cells my values for the other sheets are off every time i run the code.

Now, i'm trying to tackle this problem using a formula. this is what i have.

=IF(ISNUMBER(MATCH("P/E Ratio (TTM)",Data!AR1:BA149,0)),AX3, "-")

i 'think' it will work, but i have two concerns. my first problem is that because i am searching for text ("P/E Ratio (TTM)") that was returned through the web query, it will not locate the text.

my second problem is that when the text is found, i want the formula to return the cell directly next to the text. or two cells from the text, etc. currently it won't do that...

Any thoughts?

Thanks! gger:confused::eek:
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
you could clean up the query to return comma delimited values to allow you to manage empty fields. This should also even out the data to be consistent each time.

if you want to stick with the way you're going about it, try the OFFSET function and feed in the result of the MATCH function.
 
Upvote 0
you could clean up the query to return comma delimited values to allow you to manage empty fields. This should also even out the data to be consistent each time.

if you want to stick with the way you're going about it, try the OFFSET function and feed in the result of the MATCH function.

How would i go about cleaning up the query? what are comma delimited values?

sorry, i'm fairly new to this...
 
Upvote 0

Forum statistics

Threads
1,215,148
Messages
6,123,301
Members
449,095
Latest member
Chestertim

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