×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# MathCAD 15 - For a given value, find value greater than in a table and return a string in column 2.

## MathCAD 15 - For a given value, find value greater than in a table and return a string in column 2.

(OP)
Hi all, new to these forums, stumbled upon looking for MathCAD help.

I have tried a couple of things without success so far. I have a 7x2 table like so:

7.09 HA28
8.37 HA32
11.24 HA36
13.75 HA40
17.12 HA45
22.02 HA50
29.3 HA60

For a given value calculated elsewhere, I want to be able to compare that value with column 1 and find the first value that is greater than the given value and return the text in column two.

So for example:

Given Value:
r1: 12.5

Table finds 13.75 >= 12.5

Output:
HA40

I've looked at the lookup functions but am not sure if it is able to/how to compare numerical values that do not match (finding a value greater than) then output a string format? Also considered that the may be a loop involved somewhere..

I have done something similar in excel before but am fairly new to MathCAD.

Any help would be appreciated.

Thanks

### RE: MathCAD 15 - For a given value, find value greater than in a table and return a string in column 2.

(OP)
Another way I have tried is making two 7x1 vectors (M1 & M2) then using the following:

A1:= match(r1,M1) =

A2:= M.2.A1 =

Couple of problems with this, A1 does not make use of my greater than or equal to requirement ie. it only works when r1 is equal to one of the entries in A1

A2 uses the display tool. It is meant to return the entry in M2 corresponding to the integer entered however I need this to vary, it needs to be A1 really however it won't allow a non integer value, even though A1's answer is an integer.

As I said this doesn't work, it's just something I've tried so far. I'm sure there is a much cleaner way to achieve this.

### RE: MathCAD 15 - For a given value, find value greater than in a table and return a string in column 2.

(OP)
Hey Occupant,

That code worked a treat. Thanks a bunch!

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

#### Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a partâ€™s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!