We are aware of an issue causing intermittent login problems for some users following a recent update. Learn More
Hello,
I am reading values from an Excel sheet. I was building on the answer that Werner had for one of the questions. I have attached both P10 sheet and the excel sheet i am reading from. I was able to read the values for some but not others. The problem is there are dashes at TPP3,TPP5,...
Thanks,
Sam
Solved! Go to Solution.
The reason you are getting the error is that you are multiplying the dashes by a unit (in.lbf), and Mathcad raises an error when multiplying a scalar by a string..
How do you want to handle the dashes within the rest of your worksheet? Eg, convert them to zero or NaN.
Stuart
Hi Stuart,
Is it possible to read the excel sheet by skipping the row with dashes
by specifying certain cells like F13:F14, F16:17,.. that corresponds to:
Regards,
Sam
Hi Sam,
Yes, it's possible to skip rows, but what values do you want to put in the TCn variables in their place?
Stuart
For example, you could do something like the following, Sam.
Stuart
I appreciate it. Thanks a lot Stuart!
Sam
No worries, Sam.
Stuart
Just a side note.
When you replace non-scalar values by NaN's, you can add the appropriate unit as Prime allows adding units to NaN. "IsNaN" still works OK if you later need to check if a variable was replaced by an NaN or has a numeric value:
You may also read, replace strings and add units in one go, however, readability suffers as a result.
Doh!
This is what comes of changing one's mind whilst typing. There is no need for the input parameter repval, as it isn't used. The replace function simply replaces any non-scalar value with newval. However, a more general replace function might prove useful, which uses the repval as an input argument, so here are two versions of replace, side by side.
Stuart