Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
working on a table with a long list of items. need to query the table to see if an item is listed without erroring out every time.
how can I check to see if "Black" is on the list and return a "N/A" or something I can use?
Any help will be appreciated. Ed.
You may use "try... on error ..." in your function SPBKUP to catch the error and return an appropriate result like NaN or a text message.
You may also consider using just lookup in your function ColNo instead of that combination of hlookup and match..
Actually I see no need for the function ColNo.
You could simply use
Of course you can replace indices 0 and 1 by ORIGIN and ORIGIN+1 to make the function ORIGIN independent.
For further help and future questions pls attach your worksheet and state which version of Prime you are using.
Working with Prime 8. see attachment. should be moving to 10 next week.
As Werner says, you can use the try programming operator. One possibility for a not-found value you can easily test and which has certain other advantages (and disadvantages) is the NaN, meaning Not a Number. You can use the built-in function IsNaN to check whether a value is a NaN.
Mathcad Prime 10 worksheet attached.
Stuart
Mathcad Prime 10 (and probably 8 ) Help on NaN.
NaN and undefined
•When you evaluate NaN symbolically, the result is the undefined constant.
NaN Related Function
So I wonder why you did not try the function I posted?
It works as expected:
@Werner_E wrote:
So I wonder why you did not try the function I posted?
It works as expected:
Given black is often defined as the absence of colour and any colour not in the set {Red, Blue,Green,Yellow} is absent, would "Black" be a suitable value for an absent colour?
Stuart
And people wonder why a) I spend all night awake cogitating over the whichness of the what and the whyness of the where, b) I never get invited to parties ... except by philosophers, and who wants to attend those kind of parties? Not even Professor Pettigrew doing her famous dance of the ℵα veils could entice me to such a party (at least they're countable, which is something, I suppose). Of course, if they had some decent beer, that might be another matter ... maybe if somebody could perform a Banach–Tarski operation on the beer barrel ... Hmm. I'll have to think about that one. Ah well, time for a coffee, I suppose.
.