Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- How to search a Matrix for a number bounded by ano...

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-04-2015
07:15 PM

02-04-2015
07:15 PM

In the attached Prime worksheet is it possible to create a function that can search the second row of the matrix for the a number closest but higher than ZxREQ while also making sure that it's corresponding value in the first row is between dmax and din? The issue I'm having is how do you search in a particular row in a matrix?

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-04-2015
09:12 PM

17 REPLIES 17

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-04-2015
07:26 PM

02-04-2015
07:26 PM

Re: How to search a Matrix for a number bounded by another number?

From the file you posted it looks like you are searching a value in the second ** column**, not in the second

BTW, what should the outpit of that function be? A list(vector) of indices as Match would return? The first value of the second column which fits? A vector of all values of the second column which fit? The samllest value in the second column that fits? ...

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-04-2015
07:38 PM

02-04-2015
07:38 PM

Re: How to search a Matrix for a number bounded by another number?

You're right, I did mean the second column.

The function would output the corresponding value in a third column which I will add.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-04-2015
07:47 PM

02-04-2015
07:47 PM

Re: How to search a Matrix for a number bounded by another number?

Then you should setup a sheet with complete data!

So the value in the second column should be > (or >= ) ZxREQ?

The value in the first column should be between d.min and d,max. Usually this would exclude values equal to d.min or dmax. Is that correct?

The output cant be just a value but rather a vector of corresponding values from the third column as it may not be only a single value which fulfills tghe conditions.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-04-2015
08:08 PM

02-04-2015
08:08 PM

Re: How to search a Matrix for a number bounded by another number?

Here are two different ways of achieving what you demanded so far (no error checking implemented so far):

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-04-2015
09:12 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-06-2015
12:37 PM

02-06-2015
12:37 PM

Re: How to search a Matrix for a number bounded by another number?

Thank you for your help Werner, is it possible to create a vlookup that looks in a specified column, not just the first column?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-06-2015
01:59 PM

02-06-2015
01:59 PM

Re: How to search a Matrix for a number bounded by another number?

Daniel Sochor wrote:

Sure, look at the last two approaches I posted and change the 0 index to whatever column you want.

When you try to develop a generic new routine I guess the most labourious part would be to implement the various modifiers ("range", "neq" ,....).

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-06-2015
05:22 PM

02-06-2015
05:22 PM

Re: How to search a Matrix for a number bounded by another number?

This is a very elegant solution. Can it only return integers or can it be modified to return text in parenthesis?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-06-2015
05:53 PM

02-06-2015
05:53 PM

Re: How to search a Matrix for a number bounded by another number?

Daniel Sochor wrote:

I am not sure what you mean?

If the values in the column vlookup should return are strings, you will get a string as result.

If you are happy with "eq" and don't need the other modifiers, here is a vLookup as you requested:

Top Tags