Skip to main content
1-Visitor
January 14, 2015
Solved

Extract data from multiple tables

  • January 14, 2015
  • 10 replies
  • 3582 views

Hello everyone

I have to extract values from different tables, so according to the selected component, the required values are obtained. There is a way to do this automatically.

Attached is a sheet with what I intend to do

Best answer by RichardJ

Does this do what you want?

10 replies

Werner_E
25-Diamond I
January 14, 2015

The data you need can easily be extracted by the use of "vlookup".

1.png

If you always need the combination of values give in your sheet, you would create a function to do this in one call.

I am not sure, though, how you would intend to generalize the problem as you write in your sheet "for example with two data tables".

BPP1-VisitorAuthor
1-Visitor
January 14, 2015

Use the "vlookup" command is a good option, but the problem arises when you have multiple tables of data, and have to find that table contains the required value, which takes a long time, so I think the best option would create a function to do this.

Werner_E
25-Diamond I
January 14, 2015

... but the problem arises when you have multiple tables of data, and have to find that table contains the required value, which takes a long time ...

??? its unclear to me what you need. A program would not be able to find that one value which you require because it can't read your mind. You will have to specify in some way how to distinguish between the one value you require and the others in the same row.

RichardJ19-TanzaniteAnswer
19-Tanzanite
January 14, 2015

Does this do what you want?

BPP1-VisitorAuthor
1-Visitor
January 14, 2015

Has every reason Werner, I have made many mistakes in the formulation of the question by not including the headers of the components in Excel, and not put as a string to the desired variables "A", etc. What I was trying to achieve is precisely what you and Richard displayed with the function "get_value".

Thank you very much to you and Richard for taking the time to help me and sorry for generating misunderstandings.

1-Visitor
January 17, 2015

Mine solution:

2015-01-17_212234.jpg

I have read the http://communities.ptc.com/message/268914 , and I think "BBP" needs this function.

Werner_E
25-Diamond I
January 17, 2015

I have read the http://communities.ptc.com/message/268914 , and I think "BBP" needs this function.

Or something like the attached which I had created but Richard was faster 😉

The main problem Bryan had, as I understood, was that he has multiple tables to pick values from.

Anyway - he seems to be happy with Richard's solution.

BTW, if you want to make your approach ORIGIN-aware (and I think you want as you used ORIGIN+1), you should not use index zero in match() or column number "cols(y)-1" in submatrix().