Agree with Mike. The lookup functions should do the job, I guess. Alas, we cannot be sure as long a we don't have a worksheet which shows the correct datastructure used, shows which version of Mathcad we are talking about, shows what exactly the output should be and shows the attempts you already made.
After all its a bit unclear what the function you are demanding should provide.
- input a single part number, output the appropriate cost value
- input a vector of part numbers, output a vector of the appropriate cost values
- input a vector of part numbers, output the total sum of costs.
- input a matrix of part numbers and number of items, output the total sum of costs.
- ....