cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use lookup or match function to find the closest value in an array according to a calculated number

yhuang-3
1-Newbie

How to use lookup or match function to find the closest value in an array according to a calculated number

Hi All, I have a variable x that can be calculated by a function. I also have an array to determine the practical numbers that can be used in this variable. I want to use lookup information to find the closest information from the array based on the calculation results. However, it seems like the guides in PTC Mathcad Help cannot really solve my problem. Would anyone take a look at the attached worksheet? Thank you!

lookup.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
RichardJ
19-Tanzanite
(To:yhuang-3)

3 REPLIES 3
RichardJ
19-Tanzanite
(To:yhuang-3)

Hi Richard, would you tell me how can I modify this IndexOfNearest function, to return the value that "the closest value to the calculated one among all values smaller than calculated one"? Thank you!

RichardJ
19-Tanzanite
(To:yhuang-3)

Announcements
Check out the latest
Mathcad Tip
"PTC Mathcad 15 / Prime 1-6 Update."