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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

comparing previous value

yogeshdeshpande
7-Bedrock

comparing previous value

I am working on a mathcad worksheet where I read data from external excel file. Every time I open the mathcad worksheet, it reads file and does calculations. My question is - is there a way to remember a previous value of a certain variable with its new value and calculate the difference betwwn two?

ACCEPTED SOLUTION

Accepted Solutions

It is possible to save the value(s) using a function I found on this forum, hopefully it will work well enough for you.

Attached file accepts user input & compares against the previously saved value.

NB: <ctrl> F9 to recalculate the sheet will save the current value & give an "Equal" result.

Regards

Andy

View solution in original post

6 REPLIES 6

It is possible to save the value(s) using a function I found on this forum, hopefully it will work well enough for you.

Attached file accepts user input & compares against the previously saved value.

NB: <ctrl> F9 to recalculate the sheet will save the current value & give an "Equal" result.

Regards

Andy

How can I use it to compare multiple values in an array / matrix? I changed "Value" to one column array, but it gives error.

Saving more data is relatively easy, attached file will save data from simple variable , vector, or 2-D matrix & recover it .

If all you need is a difference then that becomes a simple subtraction.

However, if the data size can vary there are a few new issues to consider.

eg changing from a 1* 2 to 2 * 1 matrix may cause the comparison to fail.

changing from 3*1 vector to 3 * 4 matrix seems to repeatedly subtract the vector from each column - may be what you want or it could be an error - depends on your requirement.

regards

Andy

Why don't you save the values you wish to keep anmd compare in a file ynd later readin that file and the current Excel sheet?

I was trying that, but its one addional file to handle while storing and/ or sending it in email etc, so I will prefer if it can be done in mathcad itself

I plan to go with storing data in separate file and reading it again. The other method is getting too complicated to understand and make further changes. Thank you for your help

Announcements

Top Tags